[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomButton.ExecuteDefaultAction

Performs the Click method if the control is an Active or a Default button.

## Declaration

Source position: stdctrls.pp line 1248

`public procedure TCustomButton.ExecuteDefaultAction; override;`

## Description

ExecuteDefaultAction is an overridden method used to perform the Click method when the button control is Active or the Default button. No actions are performed in the method when both properties are set to False.

See Click for more information about the actions performed in the method.

ExecuteDefaultAction is called when a Return (VK_RETURN) key is handled in the Application singleton for the ActiveDefaultControl in a Form.

## See also

TCustomButton.Click |  | Handles a button click event for the control.
TCustomButton.Active |  | True if the control is the Cancel or Default button.
TCustomButton.Default |  | True if the button is the default button in a modal form.
TControl.ExecuteDefaultAction |  | Called when the Return key is pressed, signifying the default action.
TApplication.DoReturnKey |  | Interprets Enter as the default action, if applicable.