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

# TCustomButton.ExecuteCancelAction

Performs the Click method if the control is the Cancel button.

## Declaration

Source position: stdctrls.pp line 1249

`public procedure TCustomButton.ExecuteCancelAction; override;`

## Description

ExecuteCancelAction is an overridden method used to perform the Click method when the control is the Cancel button on its parent form. No actions are performed in the method when Cancel is set to False.

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

ExecuteCancelAction is called when an Escape (VK_ESCAPE) key is handled in the Application singleton for the CancelControl in a Form.

## See also

TCustomButton.Click |  | Handles a button click event for the control.
TCustomButton.Cancel |  | True if the button is the modal Cancel button.
TControl.ExecuteCancelAction |  | Called when the Escape key is pressed or the Cancel button is clicked.
TApplication.DoEscapeKey |  | Interprets Esc as Cancel action, if applicable.