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

# TToolButton.CopyPropertiesFromMenuItem

Copies properties from the specified menu item.

## Declaration

Source position: comctrls.pp line 2152

`protected procedure TToolButton.CopyPropertiesFromMenuItem(`
`const Value: TMenuItem`
`);`

## Arguments

`Value` |  | Menu item with the properties copied in the method.

## Description

CopyPropertiesFromMenuItem is a method used to copy property value from the menu item in Value into the current class instance. This ensures that the button has the same settings and behavior as the menu item assigned to the button.

No actions are performed in the method when Value has not been assigned (Nil). Calls BeginUpdate on entry, and EndUpdate when the method is completed.

The following properties are copied from the menu item in Value:

Source Property (in TMenuItem) | Target Property (in TToolButton)
--- | ---
Action | Action
Caption | Caption
Checked | Down
Enabled | Enabled
Enabled | Enabled
Hint | Hint
ImageIndex | ImageIndex
Visible | Visible

CopyPropertiesFromMenuItem is called from the Loaded method when LCL component streaming has been completed, and when a new value is assigned to the MenuItem property.

## See also

TToolButton.MenuItem |  | Contains a menu item associated with the tool button.
TToolButton.Loaded |  | Performs actions needed when LCL component streaming has been completed.
TToolButton.BeginUpdate |  | Starts an update process for the tool button.
TToolButton.EndUpdate |  | Ends an update process for the tool button.
TMenuItem |  | Represents a menu item displayed in a menu.