MDI Forms and C#

I'm sure this is a very very simple question.  How do you set up a MDI Form with child forms contained in the Parent?  I set up the MDI, but all of the child forms can be moved outside of the MDI.


LVL 15
Juan OcasioApplication DeveloperAsked:
Who is Participating?
Mike TomlinsonMiddle School Assistant TeacherCommented:
C# equivalent of emoreau's post:

    SomeChildForm f = new SomeChildForm();
    f.MdiParent = this;
Éric MoreauSenior .Net ConsultantCommented:
Hi jocasio123,

In VB.Net, we do this:
            Dim f As New fClientUHMS
            f.MdiParent = Me

It should be much the same in C#.

Juan OcasioApplication DeveloperAuthor Commented:
Can this be done through the IDE?  In 6.0 (VB) you could set the child prop to True.  Is there a property similar?
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Mike TomlinsonMiddle School Assistant TeacherCommented:'s done at run-time.
Éric MoreauSenior .Net ConsultantCommented:
>>In 6.0 (VB) you could set the child prop to True.

In VB6, you were deciding at design time if the form was to be child or not.

Now in .Net, this setting is only available at runtime and this is a good thing. You can decide if a form will be a child or not depending on some other condition. For example, experienced users prefers non-MDI windows.
Juan OcasioApplication DeveloperAuthor Commented:
Thanks..Will investigate your suggestions
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.