Allow: Boolean;
The Allow property determines whether the MDI child form can be closed.
The property is set to True by default, the form will be closed. If the property is set to False, MDI form closing is canceled.
Executing the example requires a form. This form is an MDI parent form that contains several child ones. The value of the Tag property of child 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 child MDI form, if its Tag property is 100, form closing is canceled.
See also: