Using MDI Features

See AlsoT5VI2O

Visual Basic's multiple-document interface (MDI) features enable you to create applications in which a single parent form (an MDI form17QZO3L) provides a background for multiple child formsEXWLAX (forms whose MDIChildBJG7BM property is True).  When you create MDI applications, keep the following in mind:

         When an MDI child form is the startup form, the MDI form is loaded automatically; but MDI child forms are loaded only when specified as the startup form, when referenced in code, or when specified in a LoadGU0759 statement.

         The menu bar designed for an MDI child form is displayed on the MDI form at run time when the MDI child form is active, even though it appears on the child form at design time.

         The only controls you can place on an MDI form are a picture box3W9LV25 or a custom control2SOD6E that has an Align34CYZZ5 property.  However, you can place other controls in the picture box.  Typically, you use the picture box to create a toolbar.  A picture box on an MDI form has the same width as the ScaleWidth3J8U7ZN of the MDI form, but it can have any height up to the ScaleHeight3J8U7ZN of the form.  The picture box must be aligned to the top or bottom of the MDI form client areaFXH476.

         If you want several MDI child forms in an MDI application to function identically, you can use multiple instancesCN50HF of a single form type, or an array of forms of a single type, instead of designing different child forms.  MDI child forms can be loaded or instantiated dynamically at run time using the DimLANDIM statement.  After creating a new instance of a form, you can change that instance's properties without affecting other forms.

         Use the MeLANME keyword to use common event procedures to reference the currently active instance of a form or the currently active form array element.  Similarly, the ActiveFormGCUI9X property of the MDI form specifies the MDI child form that has the focus (or that was most recently active).

         Check the WindowList check box in the Menu Design windowV4GKGG of the MDI form or an MDI child form when you want that menu control to display a list of open child forms at run time.

         Use the Arrange22JZIP method to rearrange child forms and their icons.


See Also


MDIChild PropertyBJG7BM



Programmer's Guide:

Chapter 8, "Objects and Instances"

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