class Form
A Form object.
Syntax
[<oRef> =] new Form([<title expC>])
<oRef>
A variable or property in which to store a reference to the newly created Form object.
<title expC>
An optional title for the Form object. If not specified, the title will be "Form".
Properties
The following tables list the properties, events, and methods of the Form class. With the exception of the onClose event, all Form events require the form to be open in order to fire.
Property |
Default |
Description |
|
The currently active control | |
false |
Whether dragged objects can be dropped on the Form's surface | |
2 |
Whether to hide or display the Standard Toolbar when a form recieves focus. 0=Hide, 1=Display, 2=Use the current _app object's speedBar setting. | |
false |
Whether the form automatically centers on-screen when it is opened | |
false |
Whether the form automatically sizes itself to display all its components | |
|
Background image | |
FORM |
Identifies the object as an instance of the Form class | |
(FORM) |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
false |
Whether the edge of the form has the sunken client appearance | |
BtnFace |
Background color | |
|
A view that is used when designing the form | |
|
An array containing object references to the components on the form | |
true |
Whether pressing Esc closes the form | |
|
The first component on the form in the z-order | |
|
The Windows handle for the form's client area | |
0 |
When used in conjunction with the showTaskBarButton property; determines, or specifies, the hWnd property for the parent window of a form | |
|
An icon file or resources that displays when the form is minimized | |
|
Whether the form was instantiated by the Form designer | |
true |
Whether the form can be maximized when not MDI | |
true |
Whether the form is MDI or SDI | |
|
The name of the form’s .MNU menu file | |
Chars |
Units of measurement (0=Chars, 1=Twips, 2=Points, 3=Inches, 4=Centimeters, 5=Millimeters, 6=Pixels) | |
true |
Whether the form can be minimized when not MDI | |
true |
Whether the form is moveable when not MDI | |
|
The object that’s about to receive focus | |
false |
Determines whether custom control, datamodule, menu or procedure files associated with a form are loaded in the persistent mode. | |
|
The form’s Popup menu object | |
true |
Whether to refresh the form after all form-based navigation and updates | |
|
The primary rowset | |
false |
Whether the base font used for the Chars metric is boldface | |
Arial |
The base font used for the Chars metric | |
10 |
The point size of the base font used for the Chars metric | |
Off |
When a scroll bar appears for the form (0=Off, 1=On, 2=Auto, 3=Disabled) | |
|
The current position of the horizontal scrollbar in units matching the form or subform's current metric property | |
|
The current position of the vertical scrollbar in units matching the form or subform's current metric property | |
true |
Whether to show tool tips | |
true |
Whether to display a button for the form on the Windows Taskbar | |
true |
Whether the form is resizeable when not MDI | |
false |
Whether the form has the smaller palette-style title bar when not MDI | |
true |
Whether the form’s system menu icon and close icon are displayed when not MDI | |
|
The text that appears in the form’s title bar | |
false |
Whether the form stays on top when not MDI | |
false |
Whether to use the default table navigation popup when no popup is assigned as the form’s popupMenu. | |
|
The query or table on which the form is based | |
Normal |
The state of the window (0=Normal, 1=Minimized, 2=Maximized)
| |
Event |
Parameters |
Description |
|
When attempting to close form; return value allows or disallows closure |
<workarea expN> |
When attempting to navigate in work area; return value allows or disallows leaving current record |
|
After a new record is added |
<workarea expN> |
After leaving a record that was changed, before onNavigate | |
|
After the form has been closed |
<left expN> |
When the mouse enters the Form's display area during a Drag&Drop operation |
|
When the mouse leaves the Form's display area without having dropped an object | |
<left expN> |
While the mouse drags an object over the Form's display area during a Drag&Drop operation | |
<left expN> |
When the mouse button is released over the Form's display area during a Drag&Drop operation |
|
After the form has been moved | |
<workarea expN> |
After navigation in a work area | |
<control ID expN> |
After the form is submitted | |
<expN> |
After the form is resized or changes windowState
| |
Method |
Parameters |
Description |
|
Abandons changes to the current record | |
|
Starts append of new record | |
|
Closes the form | |
|
Checks whether the current record buffer has changed | |
|
Loads and opens the form | |
|
Returns the highest pageno of any component | |
|
Prints the form | |
|
Opens the form modally | |
|
Redraws the form | |
|
Saves changes to the current or new record | |
<horizontal expN>, <vertical expN> |
Programatically scrolls the client area (the contents) of a form | |
<expL> |
Displays or hides the formatting toolbar
|
The following table lists the common properties, events, and methods of the Form class:
Description
A Form object acts as a container for other visual components (also known as controls) and the data objects that are linked to them. Consequently, releasing a form object from memory automatically releases the objects it contains.
An object reference to all the visual components in a form is stored in its elements array. All of the visual components have a form property that points back to the form.
The form has a rowset property that refers to its primary rowset. Components can access this rowset in their event handlers generically with the object reference form.rowset. For example, a button on a form that goes to the first row in the rowset would have an onClick event handler like this:
function firstButton_onClick()
form.rowset.first()
Note: With the exception of the onClose event, all Form events require the form to be open in order to fire.
If the form has more than one rowset, each one can be addressed through the rowset property of the Query objects, which are properties of the form. For example, to go to the last row in the rowset of the Query object members1, the onClick event handler would look like this:
function lastMemberButton_onClick()
form.members1.rowset.last()
A form can consist of more than one page. One way to implement multi-page forms is to use the pageno property of controls to determine on which page they appear, and use a TabBox control to let users easily switch between pages. You may also use a NoteBook control to create a multi-page container in a form.
You can create two types of forms: modal and modeless. A modal form halts execution of the routine that opened it until the form is closed. When active, it takes control of the user interface; users can't switch to another window in the same application without exiting the form. A dialog box is an example of a modal form; when it is opened, program execution stops and focus can't be given to another window until the user closes the dialog box.
In contrast a modeless form window allows users to freely switch to other windows in an application. Most forms that you create for an application will be modeless. A modeless form window conforms to the Multiple Document Interface (MDI) protocol, which lets you open multiple document windows within an application window.
To create and use a modeless form, set the mdi property to true and open the form with the open( ) method. To create and use a modal form, set mdi to false and open the form with the readModal( ) method.
You can also create SDI (Single Document Interface) windows that appear like application windows. To do so, set the mdi property to false and use SHELL(false). SHELL(false) hides the standard dBASE Plus environment and lets your form take over the user interface. The dBASE Plus application window disappears, and the form name appears in the Windows Task List.