allowClose

Type: Boolean

Availability: Read or write at run time only

The allowClose property of the Form class enables access to the status of the Control-Menu Close command. By default, a form can be closed by selecting the Close command from the Control Menu. To disable the ability to close a form by using the Close command, set the allowClose property to false. The user then cannot specifically close that form by using the Control-Menu, and the form can only be closed programmatically by using the unloadForm method.

If the form is an MDI child, closing the MDI frame of the form also closes the child form.

Setting the allowClose property to false does not affect the calling of the unloadForm method when the form is unloaded.

If the controlBox property of the form is set to false, the allowClose property is always false. If the controlBox property is changed from false to true, the allowClose property is reset to true.