Visual Basic Reference

MDIChild Property

See Also    Example    Applies To

Returns or sets a value indicating whether a form is displayed as an MDI child form inside an MDI form. Read only at run time.

Syntax

object**.MDIChild**

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Settings

The MDIChild property settings are:

Setting Description
True The form is an MDI child form and is displayed inside the parent MDI form.
False (Default) The form isn't an MDI child form.

Remarks

Use this property when creating a multiple-document interface (MDI) application. At run time, forms with this property set to True are displayed 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 is displayed like any other form because the form is displayed 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 modal.

  • The initial size and placement of MDI child forms are controlled by the Microsoft Windows operating environment unless you specifically set them in the Load event 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 isn't loaded.

Note   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 MDIForm object, including reading or setting properties, causes the form to load and become visible.