I have two forms, in Form1 a create objects from a class and puts into list (list of objects). then I have another list of strings which is supposed to be a source for
You can create a method to populate the list on Form2 (I called it SetAllPeople
):
public partial class Form2 : Form
{
public void SetAllPeople(List input)
{
foreach (string s in input)
{
lsbResidents.Items.Add(s);
}
}
public Form2()
{
InitializeComponent();
}
}
and then call Form2
this way:
Form2 lista = new Form2();
lista.SetAllPeople(allPeopleSource);
lista.ShowDialog();