The Button Control

Hierarchy: TObject - TPersistent - TComponent - TControl - TWinControl - TButtonControl - TButton

This control provides a button on a form, which can be used to launch other actions.

Significant Properties

Cancel

When set to true the button's OnClick event handler executes when the user presses the Escape key. A user may use the Tab key to move to the button.

Default

When set to true the button's OnClick event handler executes when the user presses the Enter key. A user may use the Tab key to move to the button.

ModalResult

When set to true a button in a modal dialogue box will close that box and return the modal result to its parent form. Modal results are listed in the property in the Object Inspector and include mrNone, mrOK and mrCancel. Thus one button could be set to mrOK so it returns this value when clicked, while another could be set to mrCancel. In this way no OnClick handlers are required.

Back to Tutorial

Back to Palette List