PRB: Accelerator Keys Don't Work with Disabled MDI FormLast reviewed: October 30, 1995Article ID: Q129804 |
The information in this article applies to:
SYMPTOMSWhen a MDI Form is programmatically disabled (Form1.Enabled = False), accelerator keys on the MDI Parent form will not respond to user input.
CAUSEBy disabling the window with the keyboard focus, you now have a disabled window with the focus. Because it has the focus, all keystrokes are directed to it, but because it is disabled, those keystrokes are not processed. This is true even for accelerators on the MDI parent form.
RESOLUTIONThis behavior exists in both versions 3.0 and 4.0 of Microsoft Visual Basic for Windows. This is, in fact, standard Windows MDI behavior. The solution is to always move the focus off the MDI child form when it becomes disabled programmatically. If the focus is on a disabled MDI child, the accelerator keys will not work under Windows, because Windows doesn't send up the WM_KEYDOWN message that Visual Basic would have to process for the accelerator's keystroke.
STATUSThis behavior is by design. This is standard Windows MDI form behavior.
MORE INFORMATION
Steps to Reproduce Behavior
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |