Share via


Assigning Access Keys to Menu Commands

You can assign an access key (a mnemonic that allows the user to select the menu with the keyboard) to your menus and menu commands.

To assign an access (shortcut) key to a menu command

  • Type an ampersand (&) in front of a letter in the menu name or command name to specify that letter as the corresponding access key. For example "&File" sets ALT+F as the shortcut key for the File menu in applications written for Microsoft Windows.

    The menu item will provide a visible cue that one of the letters has a shortcut key assigned to it. The letter following the ampersand will appear underlined (contingent on the operating system).

    Note

    Make sure all the access keys on a menu are unique by right-clicking your menu and choosing Check Mnemonics from the shortcut menu.

For information on adding resources to managed projects, please see Resources in Applications in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resources strings to properties, see Walkthrough: Localizing Windows Forms and Walkthrough: Using Resources for Localization with ASP.NET.

Requirements

Win32

See Also

Reference

Menu Editor

Menus