Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 22:41pm
v2

Change the property of your form like

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

C#
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
 
Share this answer
 
Have another problem..
After this all styles and fonts of child form get changed....
 
Share this answer
 
Comments
Mantu Singh 31-Jan-13 5:19am    
Use comment under question to elaborate or further query Do not post your query in solution!!
For the Form you want to make it MDIParent, just set it's 'IsMdiContainer' property to 'True'.

C#
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
 
Share this answer
 

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