Click here to Skip to main content
15,849,721 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there

Say you have a main form with one or more toolstrips and you are adding an MDI child as follows (in MDI parent)

frmChild frm = new frmChild();
frm.TopLevel = false;
frm.Parent = this;

In this case the child form appears underneath my toolstrip.

Is there a simple way to prevent this?
Updated 16-Aug-11 4:52am

You should set MdiParent, not Parent.

Do you want a better advice? Don't torture yourself and never scare off your users: never use MDI.
Question on using MDI windows in WPF[^],
MDIContainer giving error[^].

Share this answer
Ryan Minor 17-Aug-11 14:49pm    
I see your point about MDI. I got rid of MDI because it was a pain in the a**.
Sergey Alexandrovich Kryukov 17-Aug-11 15:11pm    
Right, and the worst thing is that it makes using application very inconvenient. Simple TabControl-based interface is much better; there are many other good variants with just one main application window.
Thank you,
Why are you setting TopLevel to false? That might be your problem.

EDIT ===============

If whoever is voting answers a 1 is going to do that, at least be a man and say why. If my answer is wrong, I'll delete it, but you have to prove to me it's wrong first.
Share this answer
Top Level to false making it hidden behind other forms. So, remove that statement. It will definitely work.
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