c# - Get Application first run Form -
i have 2 forms in project. when application runs, form1
opened. after opening form2
.
how can access form1
form2
reflection?
why want use reflection this?
when create second form, pass in reference first one:
// assume it's code within form1 opens form2 form2 form2 = new form2(this); form2.show();
that's assuming you're happy add constructor form2
parameter. alternatively, make property in form2
:
form2 form2 = new form2 { form1 = }; form2.show();
Comments
Post a Comment