Click here to Skip to main content
14,366,827 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have windows c# application. In which I want to convert 1 of my form into MDIParent and all other forms as childs.. Is there any way to do so? plz help... its urgent
Posted
Updated 30-Jan-13 23:41pm
v2
Rate this:
Please Sign up or sign in to vote.

Solution 1

Change the property of your form like

IsMdiContainer to True then use the following code to open the other form as the child form

ChildFrm c=new ChildFrm();
c.MdiParent=this;
c.Show();


//note You can't show a child form as Modal form using ShowDialog() it will result in error
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

Have another problem..
After this all styles and fonts of child form get changed....
   
Comments
Mantu Singh 31-Jan-13 5:19am
   
Use comment under question to elaborate or further query Do not post your query in solution!!
Rate this:
Please Sign up or sign in to vote.

Solution 3

For the Form you want to make it MDIParent, just set it's 'IsMdiContainer' property to 'True'.

IsMdiContainer = true;


Then Open Child Forms inside it.
If at any moment of time in your Application you are expecting to make another Form MDIParent, then you have to Make this property False here in the present MDIParent.

Regards
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100