GetFirstSheet

Description

Obtains the top sheet in the MDI frame, which may or may not be active.

Applies to

MDI frame windows

Syntax

mdiframewindow.GetFirstSheet ( )

Argument

Description

mdiframewindow

The MDI frame window for which you want the top sheet

Returns

Window. Returns the first (top) sheet in the MDI frame. If no sheet is open in the frame, GetFirstSheet returns an invalid value. If mdiframewindow is null, GetFirstSheet returns null.

Usage

To cycle through the open sheets in a frame, use GetFirstSheet and GetNextSheet. Do not use these functions in combination with GetActiveSheet.

NoteDid GetFirstSheet return a valid window? Use the IsValid function to find out if the return value is valid. If it is not, then no sheet is open.

Examples

Example 1

This script for a menu selection returns the top sheet in the MDI frame:

window wSheet

string wName

wSheet = ParentWindow.GetFirstSheet()

IF IsValid(wSheet) THEN

    // There is an open sheet

    wName = wsheet.ClassName()

    MessageBox("First Sheet is", wName)

END IF

See also