Microsoft KB Archive/195294

= PRB: Emulator Traps KeyDown Event for Arrow Keys =

Article ID: 195294

Article Last Modified on 3/18/2005

-

APPLIES TO


 * Microsoft Windows CE Toolkit for Visual Basic 6.0
 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q195294



SYMPTOMS
In a project created with either the Windows CE Toolkit for Visual Basic (VBCE) or eMbedded Visual Basic (eVB), 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
 Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default. Add a text box, two command buttons, an option button, and a check box to Form1. Set the MultiLine property of the text box to True and the ScrollBars property of the Textbox to 2 - Vertical.  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  Run the project in the emulation environment. Use ARROW keys to move through the command buttons, check box, and option button. Note that the KeyDown event procedures are triggered, which is indicated by the text added to the text box. Running the same project on a remote device, the KeyDown event procedures are not triggered.

Additional query words: Key Down KeyPress wce wince vbce evb vbce6

Keywords: kbtoolkit kbprb KB195294

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.