GetActiveSheet

Description

Returns the currently active sheet in an MDI frame window.

Applies to

MDI frame windows

Syntax

mdiframewindow.GetActiveSheet ( )

Argument

Description

mdiframewindow

The MDI frame window for which you want the active sheet


Return value

Window. Returns the sheet that is currently active in mdiframewindow. If no sheet is active, GetActiveSheet returns an invalid value. If mdiframewindow is null, GetActiveSheet returns null.

Usage

Use the IsValid function to determine whether GetActiveSheet has returned a valid window value.

Examples

These statements determine the active sheet in the MDI frame window w_frame and change the text of the menu selection m_close on the menu m_file on the menu bar m_main. If no sheet is active, the text is Close Window:

// Declare variable for active sheet
window activesheet
string mtext
 
activesheet = w_frame.GetActiveSheet()
IF IsValid(activesheet) THEN
    // There is an active sheet, so get its title;
    // change the text of the menu to read
    // Close plus the title of the active sheet
    mtext = "Close " + activesheet.Title
    m_main.m_file.m_close.Text = mtext
 
ELSE
    // No sheet is active, menu says Close Window
    m_main.m_file.m_close.Text = "Close Window"
END IF

See also

IsValid