Specifying Access Keys

See AlsoXBA9N2

An access key gives the user quick keyboard access to a menu, command, or control.  Unlike shortcut keys1PC5IWB, access keys do not execute commands when pressed.  At design timeCFSL0V, you designate a letter in the caption to be the access key.  At run timeCYRM35, this letter is underlined, and the user can access the menu or command by pressing Alt plus the letter.

To assign an access key to a control with the Properties windowO00AW8

   1. Click the control to select it.

   2. From the Properties window1K6JQPY, select Caption.

   3. Type the caption in the Settings boxAV4YN4.  Include an ampersand (&) in the caption immediately preceding the character you want to appear underlined at run time.  For example, if you type "&Add," the caption on the control appears as Add, and the access key is Alt+A.

   4. Click the Enter button1MFBOJ1.

 

To assign an access key to a menu or command with the Menu Design windowV4GKGG

   1. Click the form5272EF with the menu bar.

   2. From the Window menu, choose Menu Design (Ctrl+M).

   3. In the Caption text box, type the menu name as you want it displayed on the menu bar.  Include an ampersand (&) immediately preceding the character you want to appear underlined at run time.  For example, if you type "Fi&le" the caption on the control appears as File, and the access key is Alt+L.

   4. Choose OK.


See Also

Help:

Creating a Menu Bar1DSHCUG

 

Programmer's Guide:

Chapter 3, "Creating and Using Controls"

Chapter 4, "Menus and Dialogs"