First, let me say that I abominate this feature in Windows Vista and Windows 7. Second, I want to do it. Here is a question asking how to do what I want here, in WPF.
I want to do the same thing, but in Delphi, using VCL stock components, TMainMenu or Action Manager menus, or some available third party components, even Toolbar2000 or some other library.
Feature of Windows Vista/Windows 7 explorer main-menus:
- it's not visible when the app starts
- pressing and releasing Alt makes it visible
- pressing and releasing Alt again makes it invisible again
- repeatable.
- hotkeys work on menu items, even when menu is invisible*
(* Windows Explorer Hotkeys Example: Ctrl+A in Microsoft Windows Explorer selects all even when the menus are invisible, Alt+T = bring up Tools popup menu, even when the whole menu is hidden).
Update: Demo using accepted answer can be downloaded here. (HiddenMenu.zip)
Use a
TMainMenu
with aTActionList
as usual.Then do
(or simply remove the
Menu
association at design time) andand
Don't forget to set the form's
KeyPreview
totrue
.(Notice that, since the shortcuts are handled by the
TActionList
, they work even if the menu is 'gone'.)