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

  • Thread starter Thread starter KVullo
  • Start date Start date
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?
 
As for as I know, you can only have 1 MDI Parent in a project at a time.
-paul
 
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.
 
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.
 
Back
Top