Is there ANY way to have an MDI form INSIDE another MDI form?

K

KVullo

I am trying to create an application that has a Main MDI
form that allows opening multiple sub-MDI forms within the
Main MDI form.

When I run this scenario in C#, I get a exception thrown
saying that a form cannot be both a MDIParent and a
MDIChild.

Is there any kind of work around or third-party control
that can help me produce this result?
 
P

Paul Hetherington

As for as I know, you can only have 1 MDI Parent in a project at a time.
-paul
 
J

Joe White

No, I've tried having multiple simultaneous MDI parents and it works fine.
That's why there's an MdiParent property -- because there could be more than
one possible parent.

But they're separate windows -- you can't nest them. The underlying Windows
implementation isn't meant to allow nesting, with good reason. Having
multiple resizable, minimizable windows inside other resizable, minimizable
windows that are themselves inside another resizable, minimizable window
would just be hellishly complicated and confusing. The user would wake up
in the middle of the night with nightmares about clicking the wrong close
button. (Most users have enough trouble with two close buttons -- why would
you want to inflict three on them?)

That said, you could always try putting one form inside another, by setting
the inner form's TopMost to false and then its Parent to the outer form.
But the inner form won't cooperate with any Docked controls in its parent,
you won't be able to access its system menu (or close it) via the keyboard,
if you minimize it you'll never see it again, and the title bar will always
paint as inactive. Enter at your own risk.
 
K

ken

I dont believe you can nest mdi parents.
Look at the toplevel property. You can put a form inside
another form, but the inner form cannot be toplevel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top