The information in this article applies to:
SUMMARY
When a Visual Basic menu is pulled down, all non-menu keystrokes are
disabled and keystrokes cannot be detected. This behavior is by design.
When a menu is down, all keystrokes just beep or do nothing, except
for the keystrokes that control the menu. MORE INFORMATIONAccess Keys Give a User Keyboard Access to Menu ItemsTo give a user keyboard access to a menu item, insert an ampersand (&) immediately in front of a letter in the Caption by using the Menu Design Window. At run time, this letter (called the access key) is underlined. The user can change the focus to a menu or command by pressing ALT plus the letter (access key).You can use an access key such as ALT+F to give focus quickly to a menu, command, or control by using the keyboard as an alternative to the mouse. Unlike shortcut keys (such as F10 or CTRL+T, which are also assigned in the Menu Design Window), access keys do not execute commands when pressed, until the ENTER key is pressed. If you open a menu with an access key, then all non-menu keystrokes are disabled until you press a menu-control key such as ENTER, ESC, or ALT. Step-by-Step ExampleTo trap all keystrokes in the form instead of the form's controls, you can set the form's KeyPreview property to True. However, because menu controls disable non-menu key presses when the menu is down, you won't be able to preview or trap keys that are pressed when the menu is down, as this example demonstrates:
Additional query words: 2.00 3.00
Keywords : |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |