BUG: KeyPress Event Behaves Differently in a Compiled Executable (299615)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
This article was previously published under Q299615 SYMPTOMS
After displaying a dialog box in the KeyDown event, the KeyPress event is not raised when you run a project in the Integrated Development Environment (IDE). However, if you build the project into an executable file, the KeyPress event is raised. The behavior of the KeyPress event should be the same in a built executable as it is in the development environment. This inconsistency is observed with form and control keyboard events.
RESOLUTION
To work around this problem, store and use the window handle of the form or control that raises the KeyDown event to determine if the code in the KeyPress event should be run.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbActivexEvents kbBug kbCompiler kbForms kbIDEProject KB299615 |
---|
|