Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 window forms parent form, child form and 3rd is sample form.
i have opened child form in parent form by using parent MenuStrips option .following code is used ...
C#
private void ChildFormToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (var child in this.MdiChildren)
{ child.Close(); }
this.menuStrip1.MdiWindowListItem = ChildFormToolStripMenuItem;
ChildForm Cf = new ChildForm();
Cf.MdiParent=this;
Cf.Show();
Cf.WindowState = FormWindowState.Maximized;
}


this is working properly..
now i want to open 3rd sample form in parent form by clicking a button on child form.

From a button on child form i want to open a 3rd sample form inside parent form.

thank you.
Posted

1 solution

So create an event in the child form which the parent handles. The parent then creates the sub form and displays it.
It's very easy to do: Transferring information between two forms, Part 2: Child to Parent[^] explains the process (among other things)
 
Share this answer
 
Comments
Maciej Los 7-Apr-13 6:01am    
+5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900