[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TCustomForm.MDIChildren

Provides indexed access to MDI child forms when used as a MDI form.

## Declaration

Source position: forms.pp line 788

`public property TCustomForm.MDIChildren[I: Integer] : TCustomForm read GetMDIChildren;`

## Description

MDIChildren is a read-only indexed TCustomForm property which provides access to the child forms in a Multi-Document Interface (MDI) application. In an MDI application, one of the forms acts as the main form for the application, and is the container for its MDI child forms. In addition, a MDI child form can be nested in another MDI child form.

Remark: | Historically, support for MDI is dependent on the underlying widgetset or platform. Some widgetsets provide better support for MDI than others. The consensus is that the QT/QT5 widgetsets offers the best level of support for MDI applications.

The form role is determined by the value in the FormStyle property. fsMDIForm is used for the main form, and fsMDIChild for the child forms. MDIChildren is relevant when the current form instance uses one of these MDI form style values.

Index is an Integer value is used to access a MDI child form by its ordinal position in MDIChildren. The return value contains the TCustomForm instance at the specified position, as determined using the GetMDIChildren method in the widgetset class. The return value can be Nil when the current form does not use a FormStyle with the value fsMDIForm or fsMDIChild, or when a handle has not yet been allocated for the form instance. The return value is always Nil at design-time.

Use MDIChildCount to get the number MDI child forms for the form instance.

Use ActiveMDIChild to get the active MDI child form in the application.

Set the value in the FormStyle property to indicate that the class is used as a MDI form.

## See also

TCustomForm.FormStyle |  | Indicates the style for the form.
TCustomForm.MDIChildCount |  | Provides indexed access to MDI child forms when used as a MDI form.
TCustomForm.ActiveMDIChild |  | Returns the currently active MDI child form.