DOCUMENT:Q195294 06-NOV-1998 [vbwin] TITLE :PRB: Emulator Traps KeyDown Event for Arrow Keys PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:1.0 OPER/SYS:WINDOWS KEYWORDS:kbVBp kbVBp500 kbWinCE100 kbToolKit ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Windows CE Toolkit for Visual Basic 5.0, version 1.0 --------------------------------------------------------------------- SYMPTOMS ======== In a project created with the Windows CE Toolkit for Visual Basic (VBCE), KeyDown event procedures are triggered in the emulator when using ARROW keys to navigate among buttons on a form. This behavior does not occur on remote devices. MORE INFORMATION ================ This problem should only affect testing of VBCE applications. KeyDown event procedures for non-editing controls such as command buttons, checkboxes, and option buttons, are not triggered using ARROW keys in applications made with regular Visual Basic and VBCE applications run on remote devices. These event procedures do occur when running VBCE applications in the emulation environment. Only when testing VBCE applications in the emulation environment will this incorrect behavior occur. Steps to Reproduce Behavior --------------------------- 1. Create a new VBCE project in Visual Basic. Form1 is created by default. 2. In Form1, add a Textbox, two CommandButtons, an Option Button and a Checkbox. 3. Set the Multiline property of the Textbox to True. 4. Add the following code to the Form1 code module: Private Sub Check1_KeyDown(KeyCode As Integer, Shift As Integer) Text1.Text = Text1.Text & vbCrLf & "Check1 KeyDown: " & KeyCode End Sub Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer) Text1.Text = Text1.Text & vbCrLf & "Cmd1 KeyDown: " & KeyCode End Sub Private Sub Command2_KeyDown(KeyCode As Integer, Shift As Integer) Text1.Text = Text1.Text & vbCrLf & "Cmd2 KeyDown: " & KeyCode End Sub Private Sub Option1_KeyDown(KeyCode As Integer, Shift As Integer) Text1.Text = Text1.Text & vbCrLf & "Option1 KeyDown: " & KeyCode End Sub Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Text1.Text = Text1.Text & vbCrLf & "Text1 KeyDown: " & KeyCode End Sub 5. Run the project in the emulation environment. Use ARROW keys to move through the CommandButtons, Checkbox, and Option Button. Note that the KeyDown event procedures are triggered, indicated by the text added to the textbox. Running the same project on a remote device, the KeyDown event procedures are not triggered. REFERENCES ========== Books Online for Microsoft Windows CE Toolkit for Visual Basic 5.0. Additional query words: Key Down KeyPress wce ====================================================================== Keywords : kbVBp kbVBp500 kbWinCE100 kbToolKit Version : WINDOWS:1.0 Platform : WINDOWS Issue type : kbprb ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.