About Button components
Button (PushButton) components initiate an action such as running a procedure or launching a form.
To define the action initiated by a button, specify an event handler for the button's Primary event in the Events properties sheet.
Note: To display "\n" in the caption instead of it
being interpreted as a new line, set the No Interpret New
Lines property to TRUE.
To display a bitmap or icon on a button, set the Bitmap File Name property in the Component properties sheet.
The framework provides several specialized forms of buttons, some of which are available from the designer Toolbox, and some of which are only available from the Type property on the Component properties sheet:
- CancelPushButton (available only from the Type list): This is a specialized button component that is preset to cancel the current action and close the form.
- DefPushButton (available only from the Type list): This is a specialized button that becomes the default button for an action when the user presses the Enter key. If another button or component has received the focus after a form is opened, then that component is acted upon when Enter is pressed; this key becomes the default action only if the focus has not been manually moved elsewhere.
- Hyperlink Button: This is a specialized button component that allows you to create a "button" that looks and behaves like standard hyperlinked text.
- Toolbar Button: This is a specialized component that creates a button intended to appear on the main toolbar. This is not, strictly speaking, a "push button" like the others, but is more like a toolbar icon.