Activate

Description

Occurs just before the window becomes active.

Event ID

Event ID

Objects

pbm_activate

Window


Arguments

None

Return Values

Long.

Return code choices (specify in a RETURN statement):

0 -- Continue processing

Usage

When an Activate event occurs, the first object in the tab order for the window gets focus. If there are no visible objects in the window, the window gets focus.

An Activate event occurs for a newly opened window because it is made active after it is opened.

The Activate event is frequently used to enable and disable menu items.

Examples

Example 1

In the window's Activate event, this code disables the Sheet menu item for menu m_frame on the File menu:

m_frame.m_file.m_sheet.Enabled = FALSE

Example 2

This code opens the sheet w_sheet in a layered style when the window activates:

w_sheet.ArrangeSheets(Layer!)

See also

Close

Open

Show