The "Read" FormSet

When a FoxPro 2.x screen is converted to Visual FoxPro form, a FormSet will always be created to contain the form. If the screen is converted from a screen set, one FormSet will be created to contain all of the forms in the screen set.

FormSet WindowType Property

The FormSet WindowType property is what identifies its contained Form(s) as operating in "read" mode. Valid values for the FormSet WindowType property are 0 (Modeless), 1 (Modal), 2 (Read), and 3 (Read Modal). For "read" mode Forms, the property must be set to 2 or 3.

If the FormSet WindowType property is set to 2, the FormSet behaves as if it were activated by the READ command. If the FormSet WindowType property is set to 3, the FormSet behaves as if it were activated by the READ MODAL command. Program execution stops at the Show method or the DO FORM command. When the FormSet is deactivated, execution continues.

The WindowType setting of a FormSet overrides the individual WindowType settings of the Form objects it contains. For example, if the WindowType property for a FormSet is set to 2, all the Form objects contained in it are read (modeless), regardless of their individual WindowType property settings.

Parameter Passing to FormSets with WindowType = 2 or 3

Visual FoxPro will pass parameters to FormSets with WindowType = 2 or 3 to the FormSet Load event. When the FormSet WindowType = 0 or 1 the parameters are passed to the FormSet Init event.

Other FormSet Properties and Events

Once the WindowType of a FormSet is set to 2 or 3, several properties and events become available for use by the program. These properties and events are included for backward compatibility and do nothing when the FormSet WindowType is not 2 or 3.

FormSet Properties

Visual FoxPro FormSet Property

FoxPro 2.x Equivalent

Functionality

ReadCycle

READ CYCLE

Specifies whether the focus moves to the first object in a FormSet when the focus moves beyond the last object in a FormSet.

ReadLock

READ LOCK

Specifies whether all records that are referenced on any of the Forms in the FormSet are locked.

ReadMouse

READ NOMOUSE

Specifies whether you can move between controls using the mouse on the Forms contained in a given FormSet.

ReadSave

READ SAVE

Specifies whether the READ command can be used to re-activate an object.

ReadTimeout

READ TIMEOUT

Specifies how long the FormSet remains active with no user input.


FormSet Events

Visual FoxPro FormSet Event

FoxPro 2.x Equivalent

Functionality

Load

#SECTION 1 Setup Code

Occurs just before the FormSet is created.

ReadActivate

READ ACTIVATE

Occurs when a new Form in the FormSet is made active.

ReadDeactivate

READ DEACTIVATE

Occurs when a new Form in the FormSet is deactivated.

ReadShow

READ SHOW

Occurs when a SHOW GETS command is issued on the active FormSet and when a FormSet is activated.

ReadValid

READ VALID

Occurs just before a FormSet is deactivated.

ReadWhen

READ WHEN

Occurs when a FormSet is activated.


FormSet Variable Scoping

Variables created in the FormSet Load of a FormSet with WindowType = 2 or 3 are scoped to the FormSet and visible to the entire FormSet, its Forms and controls. Variables created in other FormSet events (or methods) will only be visible as specified (i.e., PRIVATE, PUBLIC, or LOCAL).