Close

The Close event has different arguments for different objects:

Object

See

Application

Syntax 1 For the application object

OLE control

Syntax 2 For OLE controls

Window

Syntax 3 For windows


Syntax 1 For the application object

Description

Occurs when the user closes the application.

Event ID

Event ID

Objects

None

Application

Arguments

None

Returns

None (do not use a RETURN statement)

Usage

The Close event occurs when the last window (for MDI applications the MDI frame) is closed.

See also


Syntax 2 For OLE controls

Description

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.


Syntax 3 For windows

Description

Occurs just before a window is removed from display.

Event ID

Event ID

Objects

pbm_close

Window

Arguments

None

Returns

Long. Return code choices (specify in a RETURN statement):

Usage

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.

See also