Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey !

I want to a simple application which consists several forms. What I need is create those forms separately and add them to Mdi parent form but I can't find a way to do that . Please tell me how to do that.
(below way only creates a child form but then I cant design child form as i need)
Form2 newMDIChild = new Form2();
// Set the Parent Form of the Child window.
newMDIChild.MdiParent = this;
// Display the new form.
newMDIChild.Show();
Posted
Comments
[no name] 24-Jul-12 22:45pm    
"but I can't find a way to do that"... yes you did because you did it. "then I cant design child form"... which makes no sense. I suspect that there is a language barrier here and you are not explaining what the problem is clearly. I sure do not understand what you are trying to say.
Sergey Alexandrovich Kryukov 24-Jul-12 23:02pm    
Agree -- but I answered, please see.
--SA
Sergey Alexandrovich Kryukov 24-Jul-12 22:57pm    
Is the parent form IsMdiContainer = true?
--SA

1 solution

Please see my comment to the question. Setting a "MDI container" could solve your problem. If this does not resolve your problem yet, search for the keyword MDI here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx[^].

This is way too simple.

Now, let's look at your problem from a different point of view: : who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. I can explain what to do instead. Please see my past answers:

Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

See also this opinion:
How to Create MDI Parent Window in WPF?[^].

And read this:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^].

Still want to do it, instead of something reasonable? :-)

—SA
 
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