C# Create Child Forms
( February 2nd, 2013 Interface ) - lo-fi/printable version

Child Forms are those forms that are found inside another form (parent form). There are multiple ways to create child forms – most of them require to use a MDI Container.
C# Child Form
 

Child Forms without MDI Container

I, personally, had lots of problems when I used it (parent form’s controls were going over the child form), so I decided to create child forms without involving a MDI Container. This method will let you solve the problem with the controls that go over child forms, by allowing you to use BringToFront().
 

How to:

The main trick here is to treat child forms as Controls. You’ll create a child form just like any other control. When you use this method, you have to set it’s TopLevel to false – otherwise it won’t work.

The following lines of code are used to create a child form:


No comments yet.
Have something to say?