Form attributes
Form events
Form methods
Form attributes
Hidden
Shows or hides a form. This form attribute also can be used to determine the current state of a form; if the form is shown, the Hidden attribute is FALSE. Otherwise, the Hidden attribute is TRUE.
Syntax
[formname].Hidden [= TRUE|FALSE value]
Example
Sub Click()
If MyForm.Hidden = TRUE Then
MyForm.Title = "Form Title"
MyForm.Show
End If
End Sub
MouseX,MouseY
Retrieves the last X and Y coordinates clicked on the form body (including any protected controls).
Syntax
formname.MouseX
formname.MouseY
Example
Sub Main()
MyForm.MouseX
MyForm.MouseY
End Sub
Title
Displays the form's window title string.
Syntax
[formname].Title [=string expression]
The title can be assigned any valid string expression.
Example
Sub Click()
MyForm.Title = "My form Title"
MyForm.Show
End Sub
Top
Form events
Activate
Activates an event on a form.
The event is triggered when the form is activated. A form is activated when the form receives focus.
Click
Clicks an event on a form.
The event is triggered when the user clicks on the form body or on a protected field on the form.
Deactivate
Deactivates an event on a form.
The event is triggered when the form is deactivated. A form is deactivated when the focus is set to another form.
DoubleClick
Double-clicks an event on a form.
The event is triggered when the user double-clicks on the form body or on a protected field on the form.
Load
Loads an event.
The event is triggered when the form is first loaded or shown. A form is loaded with the Load command or shown with the Show method.
Unload
Unloads an event.
The event is triggered when a form is closed, either by clicking the close box on the form or programmatically, using the Unload command.
Top Form methods
DisableFormEvents
Disables the following form events:
Click
DoubleClick
Activate
Deactivate
and the following field events:
Click (except buttons)
DoubleClick
GotFocus
LostFocus.
This form method is useful for applications running on high usage systems. If the events listed are not used in the application, disabling these form events can reduce client-server overhead.
Syntax
formname.DisableFormEvents
EnableFormEvents
Enables form and field events disabled with the DisableFormEvents form method.
Syntax
formname.EnableFormEvents
Hide
Hides a form from view.
A hidden form is not unloaded; the form continues to exist with current attributes and values intact. Showing a hidden form will redisplay the form with all attributes set as they were prior to running the Hide form method. If the application ends, a hidden form is automatically unloaded.
Syntax
formname.Hide
Show
Displays a modeless form. If the form has not been loaded, Show will load the form and data environment before displaying.
Syntax
formname.Show
Swap
Hides a form's content and display a second form within the form's original window.
Syntax
formname.Swap(swapform)
The swapform argument can be any string expression that is a valid form name. This method allows the programmer to dramatically change the interface in the window without hiding and unhiding fields.
Be sure to put the swapform argument as a string and not a direct reference to the form object. If the swapform argument is a direct reference to the form object, the form's default attribute, Title, will be used as the swap form name.
Example
Form1.Swap("Form2) 'Correct!
Form1.Swap(Form2) 'Incorrect! Passes Form2's title as an argument.
Top
|