Events are user actions, such as clicks and mouse movements, or system actions, such as the progression of the system clock. Methods are procedures that are associated with the object and that are specifically invoked programmatically. For a discussion of events and methods, see Object-Oriented Programming. You can specify the code to be processed when an event is triggered or a method is invoked.
To edit event or method code
-
From the View menu, choose Code.
-
Select the event or method in the Procedure box.
-
In the Edit window, write the code you want to be processed when the event is triggered or the method is invoked.
For example, you could have a command button on a form with the caption "Quit." In the Click event for the button, include the line:
В Copy Code THISFORM.Release
Tip: To move between procedures in the Code Editing window, press PAGE DOWN or PAGE UP.
When the user clicks the command button, the form is removed from the screen and from memory. If you don't want to release the form from memory, you could instead include the following line in the click event:
В | Copy Code |
---|---|
THISFORM.Hide |
Note: |
---|
If code associated with the Init event of a form set, a form, or any object on any form in a form set returns false (.F.), the form will not be created. |