Windows Develop Bookmark and Share   
 index > Windows Forms Designer > MDI child and parent
 

MDI child and parent

Hi all

I Have an MDI form which is set to mdi container as true and from that form menu i am opening a new form which is a child of the main form ,from the child form i am calling a another form like

Form3 obj=new Form3
obj.show()
I want this form to be a mdi child of the Main form


Any help

Dam
damu maddy  Wednesday, February 11, 2009 3:19 PM
Hi,

here is short example:

//MainFormactsasMDIcontainer(parent)->MainForm.IsMDIContainer=true.
//InMainFormclass
privatevoidopenMdiChild()
{
Form1child1=newForm1();
child1.MdiParent=this;
child1.Show();
}
//Form2canbeopenedfromForm1.
//InForm1class
privatevoidopenMdiChild()
{
Form2child2=newForm2();
child2.MdiParent=this.MdiParent;
child2.Show();
}


Tomi Airaksinen - MCPD [Remember to click "mark as answered" when you get a correct reply to your question]
  • Marked As Answer bydamu maddy Thursday, February 12, 2009 5:30 PM
  •  
Tomi Airaksinen  Thursday, February 12, 2009 6:40 AM
Hi,

here is short example:

//MainFormactsasMDIcontainer(parent)->MainForm.IsMDIContainer=true.
//InMainFormclass
privatevoidopenMdiChild()
{
Form1child1=newForm1();
child1.MdiParent=this;
child1.Show();
}
//Form2canbeopenedfromForm1.
//InForm1class
privatevoidopenMdiChild()
{
Form2child2=newForm2();
child2.MdiParent=this.MdiParent;
child2.Show();
}


Tomi Airaksinen - MCPD [Remember to click "mark as answered" when you get a correct reply to your question]
  • Marked As Answer bydamu maddy Thursday, February 12, 2009 5:30 PM
  •  
Tomi Airaksinen  Thursday, February 12, 2009 6:40 AM

You can use google to search for other answers

Custom Search

More Threads

• File copying
• Different form views on one form
• DateTimePicker: Preventing Value change event when switching months in the pop-up calendar?
• AutoToolboxPopulate option question
• Custom glyph/behaviour problem
• Accessing Resources
• Uri problem with mail-address as authentication
• error "Object type cannot be converted to target type." in task list
• Why don't my Usercontrols show up in Toolbox of multi project sln?
• ToolStripRenderer