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.

Thanks,

jocasio
LVL 15
Juan OcasioApplication DeveloperAsked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
C# equivalent of emoreau's post:

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

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

It should be much the same in C#.

Cheers!
0
 
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?
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Nope...it's done at run-time.
0
 
Éric MoreauConnect With a Mentor Senior .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.
0
 
Juan OcasioApplication DeveloperAuthor Commented:
Thanks..Will investigate your suggestions
0
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.