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

# TToolButton.ActionChange

Implements the handler signalled when the Action for the tool button is changed.

## Declaration

Source position: comctrls.pp line 2155

`protected procedure TToolButton.ActionChange(`
`Sender: TObject;`
`CheckDefaults: Boolean`
`); override;`

## Arguments

`Sender` |  | New action for the control, or Nil.
`CheckDefaults` |  | Indicates if the property in the action must be assigned (not empty).

## Description

ActionChange is an overridden method which implements an event handler signalled when the Action for the tool button is changed.

The Sender argument is the new TCustomAction instance assigned to the Action property for the tool button.

CheckDefaults indicates when values from the action are copied into the control. When set to True, the values in the Action are applied only when its property value has been assigned.

ActionChange calls the inherited method on entry to copy properties from Sender to the control. It provides support for translating the Checked property in the action to the Down property used in the tool button. It also changes the value in ImageIndex only when a valid image index has been assigned in the Action.

## See also

TToolButton.Down |  | Indicates whether the button is in the "Down" state, i. e. has it been selected or clicked.
TToolButton.ImageIndex |  | Ordinal position in an image list for the icon displayed on the tool button.
TCustomAction.Checked |  | Whether the check box control associated with the action is Checked (default False).
TControl.ActionChange |  | Handler for a changed Action.