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:
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 |