Here is the part of the code where I create a second form on a button click.
private List<Team> Teams = new List<Team>();
private void button2_Click(object sender, EventArgs e)
{
Form Form2 = new Form2(Teams);
Form2.Show();
}
Form 2:
public Form2(List<Team> teams)
{
InitializeComponent();
}
And I’m always getting back this error:
Error 1 Inconsistent accessibility: parameter type
‘System.Collections.Generic.List<Projekt.Team>‘ is less accessible
than method
‘Projekt.Form2.Form2(System.Collections.Generic.List<Projekt.Team>)‘
Teamis most likelyinternal, so it can’t appear in the signature of apublicmethod on apublicclass.You can either make
Teampublic or the methodprivate/internal.