MDIChild Property

See Also7SAKOQ                 Example6YZ89J>Low

Applies To



Specifies whether a form will appear as an MDI child formEXWLAX inside an MDI form17QZO3L.  Read-only at run time.




The MDIChild property settings are:

Setting             Description


True                 The form is an MDI child form and appears inside the parent MDI form.

False                (Default) The form is not an MDI child form.



Use this property when creating a Multiple-Document Interface (MDI) application.  At run time, forms with this property set to True appear inside an MDI form.  An MDI child form can be maximized, minimized, and moved, all inside the parent MDI form.

When working with MDI child forms, keep the following in mind:

         At run time, when an MDI child form is maximized, its caption is combined with that of the parent MDI form.

         At design time, an MDI child form appears like any other form, since the form appears inside the parent form only at run time.  An MDI child form's icon in the Project window is different from icons for other kinds of forms.

         MDI child forms can't be hidden and can't be modal1L0L9FR.

         The initial size and placement of MDI child forms is controlled by the Windows environment unless you specifically set it in the Form_Load procedure.

         If an MDI child form is referenced before the parent is loaded, the parent MDI form is automatically loaded.  However, if the parent MDI form is referenced before loading an MDI child form, the child form is not loaded.



Note   When running under the Microsoft Windows 3.0 graphical environment, all MDI child forms have sizable borders, a Control-menu box, and Minimize and Maximize buttons, regardless of the settings of the BorderStyle, ControlBox, MinButton, and MaxButton properties.

Any reference to an MDI form, including reading or setting properties, causes the form to load and become visible.


Data Type

IntegerDOKXHY (Boolean)

See Also


ActiveControl PropertyJCXG6P

ActiveForm PropertyGCUI9X

BorderStyle Property43RNRL

ControlBox Property35ZQLA

MaxButton Property117DCC7

MinButton Property1B9HLHD

WindowList Property1XSC6RN


Programmer's Guide:

Chapter 8, "Objects and Instances"

Chapter 14, "Multiple-Document Interface (MDI) Applications"

MDIChild Property Example

The example presents an MDI form with an MDI child form and then creates another instance of the MDI child form.  To try this example, set MDIChild to True on Form1, and create an MDI form with the New MDI Form command on the File menu.  Copy the code into the Declarations section of the MDIForm and press F5 to run the program.

Sub MDIForm_Load ()
  Dim NewForm As New Form1      ' Declare new form.
  NewForm.Show                  ' Show new form.
End Sub