[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 282

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. If the menu item has been configured as a RadioItem, Checked cannot be set to False; that is handled using the logic for the radio button group.

The OnClick event handler is signalled to perform the actions for the menu item.

AutoCheck does not cause the item to become checked at design-time.

See also

TMenuItem.AutoCheck

  

Indicates whether the menu item automatically toggles the value in Checked when executed.

TMenuItem.Checked

  

Indicates whether a check mark is displayed beside the menu item.

TMenuItem.OnClick

  

Event handler signalled to perform the actions needed when the menu item is executed.

OnMenuPopupHandler

  

Unit global variable with the event handler signalled when a pop-up menu is displayed.


Version 4.0 Generated 2025-05-03 Home