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

TMenuItem.Click

Performs actions needed when the menu item is clicked.

Declaration

Source position: menus.pp line 276

public procedure TMenuItem.Click; virtual;

Description

Click is method used to perform actions needed when the menu item is clicked, or when the DoClick method is called. No actions are performed in the method if the menu item is not Enabled.

Click signals the OnMenuPopupHandler event handler variable (when assigned).

Properties in the TMenuItem instance are examined to determine whether an Action is used to execute the menu item, or if its OnClick event handler is signalled for the purpose. An action is used when the ActionLink property has been assigned for the class instance. The action is not executed if the menu item is clicked at design-time.

Otherwise, the OnClick event handler is used. When AutoCheck is enabled, the value for the Checked property is toggled when the menu item has not been configured as a RadioItem. AutoCheck is not performed at design-time. The OnClick event handler is signalled to perform the menu item.


Version 3.2 Generated 2024-02-25 Home