IMDICloseEventArgs.Allow

Syntax

Allow: Boolean;

Description

The Allow property determines whether it is possible to close the MDI child form.

The property is set to True by default, the form is closed. If the property is set to False, the MDI form closing is canceled.

Example

Executing the example requires a form. This form is a MDI parent form that contains several child ones. The value of the Tag property of the MDI forms is changed during the work.

Sub FormOnMDIClose(Sender: Object; Args: IMDICloseEventArgs);

Begin

If Args.MDIChild.Tag = 100 Then

Args.Allow := False;

End If;

End Sub FormOnMDIClose;

After executing the example, if the user tries to close the MDI child form, if its Tag property is 100, the form closing is canceled.

See also:

IMDICloseEventArgs