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

# TControlActionLink

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Links an Action to a control.

## Declaration

Source position: controls.pp line 963

`type TControlActionLink = class(TActionLink)`
`protected`
`FClient: TControl;` |  | The client control that is linked to the action.
`procedure AssignClient(); override;` |  | Called during construction, sets FClient to the given control.
`procedure SetCaption(); override;` |  | Sets the client Caption when it is linked to the Action for the control.
`procedure SetEnabled(); override;` |  | Sets the client Enabled property when it is linked to the action.
`procedure SetHint(); override;` |  | Sets client Hint when it is linked to the action.
`procedure SetHelpContext(); override;` |  | Sets the HelpContext, if the old Help properties match (IsHelpLinked).
`procedure SetHelpKeyword(); override;` |  | Sets the HelpKeyword, if the old Help properties match (IsHelpLinked).
`procedure SetHelpType(); override;` |  | Sets the HelpType, if the old Help properties match (IsHelpLinked).
`procedure SetVisible(); override;` |  | Sets the Visible property in the client, if the old values match.
`procedure SetOnExecute(); override;` |  | Set OnClick handler for the client, if the old values match.
`function IsOnExecuteLinked; override;` |  | True if the OnClick handler in the client is the same routine assigned to the OnExecute handler in the action.
`function DoShowHint(); virtual;` |  | Formats the hint string for the client control when it includes a ShortCut or accelerator key.
`public`
`function IsCaptionLinked; override;` |  | Is the action's Caption linked to the client?
`function IsEnabledLinked; override;` |  | Is the action's Enabled property linked to the client?
`function IsHelpLinked; override;` |  | Help properties are assumed linked only when all these properties match.
`function IsHintLinked; override;` |  | Is the action's Hint property linked to the client?
`function IsVisibleLinked; override;` |  | Is the action's Visible property linked to the client?
`end;`

## Inheritance

`TControlActionLink` |  | Links an Action to a control.
`TActionLink` |  | A link between an action and a client class.
`TBasicActionLink`
?
`TObject`

## Description

An ActionLink is created when an Action is assigned to the control. TControl.Action effectively becomes TControl.ActionLink.Action.

An ActionLink propagates changes in Action properties to the client control. It's assumed that properties of the same value (in the Control and Action) are linked to the Action, and follow changes to the Action properties.

Linked control properties are (by default):

- Caption
- Enabled
- Hint
- HelpContext, HelpKeyword, HelpType: these are linked only if all three property values match.
- Visible
- OnClick is linked to Action.Execute

The control can update itself, when it receives a Change notification from the ActionLink TControl.ActionChange.