i have 3 forms: FormA ,FormB and FormC of which FormA is mdiParent form and form B and C are child forms. i write the following code in FormA load event.
private void frmMain_Load(object sender, EventArgs e)
{
formB.MdiParent = this; //formB is instance of FormB
formC.MdiParent = this; //formC is instance of FormC
formB.Show();
}
what i want is when i click a button on FormB, FormC should be shown. now to do this will i need to create another instance of FormC in click event of button in FormB or should i be able to use the instancce created in FormA???
if needed to create a separate instance then can someone plz explain the reason for doing so?
edit- the answer given by Oded suits me fine. but can i make the return type of the property as Form[] in order to add more than 1 references so that if i want to go back from FormC to FormB i can use similar method?
also if i want to pass some data from FormB to FormC then how can i do that?