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

# TMenuItem.ActionChange

Changes the action for the menu item using the value specified in Sender.

## Declaration

Source position: menus.pp line 227

`protected procedure TMenuItem.ActionChange(`
`Sender: TObject;`
`CheckDefaults: Boolean`
`); virtual;`

## Arguments

`Sender` |  | TCustomAction examined and applied to the menu item.

## Description

ActionChange- changes the action associated with this menu item to a new action, provided Sender is of type TCustomAction. No actions are performed in the method when Sender is not derived from TCustomAction.

ActionChange updates property values in the current class instance to reflect the values in Sender when CheckDefaults has not been enabled. The following properties are updated from the values in the action:

- AutoCheck
- Caption
- Checked
- Enabled
- HelpContext
- Hint
- GroupIndex
- ImageIndex
- ShortCut
- Visible

ActionChange is called when a new value is assigned to the Action property for the menu item or when changes occur in the linked menu action.