Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Inkonsistenter Zugriff - Bitte um Hilfe

Empfohlene Antworten

Veröffentlicht

Hallo Community,

ich hab hier ein Problem mit C# und weiß nicht weiter. Zu allem Überfluss muss ich dringend weiterüben, was aber nicht geht mit dem Fehler.

Hier also mal die Fehlermeldung:

[CSHARP]Fehler 1 Inkonsistenter Zugriff: Parametertyp "NotenProgramm.Note" ist weniger zugreifbar als Methode "NotenProgramm.FNotenDetail.FNotenDetail(NotenProgramm.Note)" C:\Schule\IT11\CSharp\NotenProgramm\NotenProgramm\FNotenDetail.cs 17 16 NotenProgramm

[/CSHARP]

und hier die zwei Klassen, welche den Fehler betreffen:

FNotenDetail

[CSHARP]using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Collections;

namespace NotenProgramm

{

public partial class FNotenDetail : Form

{

Note n = new Note();

public FNotenDetail(Note n)

{

InitializeComponent();

//FNoten fn = new FNoten();

this.n = n;

if (n != null)

{

cboxfach = n.Fach;

}

}

private void FNotenDetail_Load(object sender, EventArgs e)

{

cboxfach.Items.Add("MSE");

cboxfach.Items.Add("C#");

cboxfach.Items.Add("Mathe");

}

private void cboxart_SelectedIndexChanged(object sender, EventArgs e)

{

cboxart.Items.Add("S");

cboxart.Items.Add("M");

}

private void cboxnote_SelectedIndexChanged(object sender, EventArgs e)

{

cboxnote.Items.Add("1");

cboxnote.Items.Add("2");

cboxnote.Items.Add("3");

cboxnote.Items.Add("4");

cboxnote.Items.Add("5");

cboxnote.Items.Add("6");

}

/* public static void Insert(Note n)

{

ArrayList al = DBNote.Laden();

al.Add(n);

DBNote.Speichern(al);

}*/

}

}

[/CSHARP]

Note

[CSHARP]using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace NotenProgramm

{

[serializable]

class Note

{

string fach = string.Empty;

DateTime dt;

string art = string.Empty;

int note;

public Note()

{

}

public string Fach

{

get { return fach; }

set { fach = value; }

}

public DateTime Dt

{

get { return dt; }

set { dt = value; }

}

public string Art

{

get { return art; }

set { art = value; }

}

public int Note1

{

get { return note; }

set { note = value; }

}

public override string ToString()

{

return Dt + " " + Fach + " " + Art + " " + Note1;

}

}

}

[/CSHARP]

Hier noch der Aufruf von FNoten

[CSHARP]private void btnNeu_Click(object sender, EventArgs e)

{

DialogResult dr = new DialogResult();

Note n = new Note();

//FNotenDetail fndetail = new FNotenDetail(n);

FNotenDetail fndetail = new FNotenDetail(n);

dr = fndetail.ShowDialog();

}

[/CSHARP]

Ich kann mir nicht erklären wieso der Fehler auftaucht.

Bitte helft mir!

Danke im Voraus.

Robin

erledigt und bitte Thread löschen.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.