Your issue is not quite clear...
If you have declared
List<MyObject>
in
Program.cs
class as:
public static List<MyObject> MyObjects;
than that list is accesible everywhere in your application. You don't need to pass it between forms.
If your
List<MyObject>
is declared in
Form1
and its "visibility" is set to
private
, then you need to pass that list to
Form2
to be able to use it. Further, if you would like to return that list via
Form2
property, then that property have to be
public
.
Form2.cs
private List<MyObject> mo;
public Form2(List<MyObject> mos)
{
mo = mos;
}
public List<MyObject> MyObjects
{
get=> mo;
}
Form1.cs
private List<MyObject> MyForm1Objects;
using (Form2 frm = new Form2(MyForm1Objects))
{
DialogResult dr = frm.ShowDialog();
if(dr= DialogResult.OK)
{
MyForm1Objects = frm.MyObjects;
}
}
Conclusion: we need more details about your issue.