Search code examples
delphidelphi-xe7

delphi - how do I make a tick in front of a TMainmenu's item?


I want to place a tick or "x" in front of a TMainMenu item when I click on it. Is there any way to do that?

image


Solution

  • Enable the menu item's AutoCheck property. The linked reference describes it as:

    AutoCheck

    Indicates whether the menu item's checked state toggles automatically when the item is clicked.

    When AutoCheck is true, then every time the menu item is clicked, the value of the Checked property toggles automatically before the OnClick event occurs. When AutoCheck is false, the application must explicitly set the value of the Checked property (for example, in an OnClick event handler).