Close Event 33
Description
A Close event is generated when an object is destroyed.
For a Form or SubForm, the event may be generated by the user selecting "Close" from its System Menu. In this case, the event is reported before the window is destroyed, and you may prevent it from going ahead by associating a callback function which returns a result of 0.
By trapping this event you can control termination of your application in many different ways. For example, you could:
- automatically close all Forms in your application when the master Form is closed.
- prevent the user from terminating the application if it is inappropriate at that time.
- display an "Are you sure ?" MsgBox.
Note that although all the object's child GUI objects will also be destroyed, none of the child objects will generate a Close event.
The event message reported as the result of ⎕DQ
, or supplied as the right argument to your callback function is a 2-element vector as follows :
[1] |
Object | ref or character vector |
[2] |
Event | 'Close' or 33 |