Useful Form_ Class Properties

All forms based on the Form_ class contain the useful properties described in the following subsections.

Tip: You should take the time to review the ďForm_ Class Properties and MethodsĒ section in the VPME 9.1 Technical Reference manual to learn about all the properties and methods available to you in the Form_ class.

Closing Other Forms When a Form Closes

The Form_ class contains a cCloseForms property that lets you identify other forms that should be closed when a form closes. To use this property for a form, enter a comma delimited list of your unique form names (Name property of the form as opposed to the name of the form file) that should be closed upon the closing of the form. Normally, you would use this property to close Related Forms when a main, or parent, Related Form closes. However, you donít have to use the property just for Related Forms.

This feature cascades. That is, if you close a form that has a list of forms in its cCloseForms property, the cCloseForms property of each form in the list will be checked and any forms listed in that formís cCloseForms property will be closed as well. This is a chain reaction down to the last form to be closed.

Form Positioning

The lRestoreWindowPos and lCenterWindow properties let you control where a form is positioned when itís activated. Both properties default to .T..

∑       lRestoreWindowPos: Determines whether a form is brought up in its last location as recorded in the MAIN<4 characters of User ID>.INI file.

∑       lCenterWindow: Determines whether a form is centered on the desktop when brought up.

These two properties work together. The result of possible combinations of these two properties are described in the following table:

lRestore

lCenter

Result

.T.

.T.

Form is positioned according to coordinates retrieved from INI file.  Form is centered if position not yet stored in INI file.

.T.

.F.

Form is positioned according to coordinates retrieved from INI file.  Form is positioned according to formís Top and Left properties if position not yet stored in INI file.

.F.

.T.

Form is centered.

.F.

.F.

Form is positioned according to formís Top and Left properties.

 

More:

Useful Form_Toolbar Properties