MDIActiveForm Property (AForm)

Returns the active MDI child form for an MDI frame form.

Syntax

[ pForm = ] Object.MDIActiveForm

The MDIActiveForm property syntax has the following parts:

 

Name

Type

Description

Object

AForm

AForm object

pForm

AForm

The active MDI child form for the MDI frame form.

Comments

This property is read-only at run time and is only applicable for MDI Form type.

Use the MDIActiveForm property to access a form's properties or to invoke its methods — for example:

MDIActiveForm.MousePointer = aformMousePointerHourGlass

This property is applicable to multiple-document interface (MDI) Forms where a button on a toolbar must initiate an action on a control in an MDI child form. For example when a user clicks the Copy button on the toolbar, your code can reference the text in the active control on the MDI child form and copy it to the clipboard (assuming tb is an ATextBox control):

Clipboard.SetText(MDIActiveForm.tb.SelText, acfText)

Note: When an active MDI child form isn't maximized, the title bars of both the parent form and the child form appear active.

Example

The following statement set the MDI Form caption to the name of the active MDI child form::

if MDIActiveForm=Nothing

Caption="My Edit"

else

Caption="My Edit - "+MDIActiveForm.Caption

endif

Applies to

AForm

See Also

ActiveControl