The Close event has different arguments for different objects:
Object |
See |
---|---|
Application |
|
OLE control |
|
Window |
Occurs when the user closes the application.
Event ID |
Objects |
---|---|
None |
Application |
None
None (do not use a RETURN statement)
The Close event occurs when the last window (for MDI applications the MDI frame) is closed.
Occurs when the object in an OLE control has been activated offsite (the OLE server displays the object in the server’s window) and that server is closed.
Event ID |
Objects |
---|---|
pbm_omnclose |
OLE |
None
Long. Return code: Ignored
If the user closed the OLE server, the user’s choices might cause the OLE object in the control to be updated, triggering the Save or DataChange events.
If you want to retrieve the ObjectData blob value of an OLE control during the processing of this event, you must post a user event back to the control or you will generate a runtime error.
Occurs just before a window is removed from display.
Event ID |
Objects |
---|---|
pbm_close |
Window |
None
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
When you call the Close function for the window, a CloseQuery event occurs before the Close event. In the CloseQuery event, you can specify a return code to prevent the Close event from occurring and the window from closing.
Do not trigger the Close event to close a window; call the Close function instead. Triggering the event simply runs the script and does not close the window.