Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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
Edited 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 at 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
0 Sergey Alexandrovich Kryukov 853
1 OriginalGriff 410
2 CPallini 275
3 George Jonsson 226
4 Richard Deeming 145
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,482
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
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