RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPopupMenu.AutoHotkeys Property

Determines whether the accelerator keys for menu items can be reset automatically.

Pascal
property AutoHotkeys: TMenuAutoFlag;
C++
__property TMenuAutoFlag AutoHotkeys;

Set AutoHotkeys to indicate whether the menu should automatically ensure that accelerator keys for its items are reset if necessary so that every menu item has an accelerator key and no two items have the same accelerator key. This ensures that menu items added dynamically at runtime can have accelerator keys that do not introduce conflicts. TMenu tries to preserve all existing accelerator key mappings when adjusting the accelerator keys, but may be forced to change some in order to ensure that every item has a unique accelerator. 

Before the menu is displayed, the menu checks and adjusts the accelerator key mappings if AutoHotkeys is maAutomatic. When AutoHotkeys is maManual, the menu does not alter the top-level menu items, but may adjust the accelerator keys for submenus, depending on the AutoHotkeys property of the menu item that is the parent of the submenu. 

When AutoHotkeys is maManual, an application can still adjust the menu items by calling the Items property's RethinkHotkeys method. AutoHotkeys merely controls whether this adjustment occurs automatically.

Note: The AutoHotkeys property of a menu is linked to the AutoHotkeys property of the TMenuItems object that implements its Items property. Setting one sets the other.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!