Click here to Skip to main content
13,052,558 members (57,408 online)
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 30-Jan-13 22:40pm
Updated 30-Jan-13 22:41pm
v2
Rate this: bad
 
good
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
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Have another problem..
After this all styles and fonts of child form get changed....
  Permalink  
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: bad
 
good
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
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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