This will display the standard Windows button on the form. The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program. This is a common object and will probably be used often on your forms. The icon for this object is on the Standard page.
PALETTE ICON & EXAMPLE
PROPERTIES
The following are the properties that apply to this object. Some are defined in Common Properties and are linked to their appropriate page.
Appearance
Caption | This is the text that is displayed on the face of the button. This is any standard string and can be changed at runtime. |
Behavior
Cancel | If this is checked (set to .True.) the Click event (see below) will execute if the user presses the ESC key. This property can be set during runtime. |
Default | If this is checked (set to .True.) the button will be the default object on the form. This means if the user presses the ENTER key it will have the same effect as if they had clicked the button. |
NOTE: If you have entry objects on the form, e.g. TTASEnter, with the ReturnIsTab property checked (set to .True.) then this will be ignored.
Font
Hint
Misc
Other
ModalResult | If this button is on a form loaded using the LOAD_MODAL_FORM() function this would be one way to set the Modal_Result property for that form. This will release the form and return the appropriate value from the function. If it is placed on a non-modal form (most often) you can still determine which button is calling by setting up a separate event (see below) or putting a value in the Tag property and checking that property in the common event called. These values are defined in COMPILERCONSTANTS.TXT. This property can be modified during runtime. |
Position
EVENTS
This object has a single event that is called if your user clicks the button. This event looks to your program for a special label. It is made up of the object Name, a period (.) and the Event name (Click). The full event name would be ObjectName.Click:. You would not return a value from the program, just a simple RET is all that is required. So, the user clicks the button, if the event label exists the routine is called, you return from the routine, and the user has control again.
NOTE: You can have multiple buttons call the same routine by 'stacking' the event labels on top of each other. For example, if you had two buttons you wanted to call the same event, you could do the following:
btnFirstButton.click:
btnSecondButton.click:
//event routine code would go here.
ret
The labels are not part of the code executed. They are just place keepers and tell the program where to go.