Search code examples
c#winformsmdiparentsplitcontainer

SplitContainer's panel as the MDI parent for other forms


I have got a control with a Splitcontainer added. I want to place another forms on the second panel (Panel2). However, it is not possible to set the MDIParent property of a brand new form to Panel2.

Thus, the question is - how can I set the SplitContainer's panel as the MDIParent for another controls?

Thank you in advance for the clues!

cheers


Solution

  • An MDIParent can only be another Form. What you need to do is set TopLevel to False on the child Form. Then you can add it to any control just like it was any other control (by adding it to the parent control's Controls collection). However, it won't work like it does in an MDI container (as in you won't be able to minimize or maximize it).