Microsoft KB Archive/255272

= BUG: CE: CommandBar Settings May Keep Key Events from Firing =

Article ID: 255272

Article Last Modified on 8/19/2005

-

APPLIES TO


 * Microsoft Windows CE 3.0 for the Handheld PC
 * Microsoft Windows CE 2.11 for the Handheld PC
 * Microsoft Windows CE Toolkit for Visual Basic 6.0

-



This article was previously published under Q255272



SYMPTOMS
When the position of a CommandBar control is set to a non-zero value at design time through either the Left or Top property and then is subsequently changed at run time through either the Move method or the setting of the Top or Left property, the Key events (KeyPress, KeyDown, KeyUp) of the form upon which the CommandBar control is sited do not fire.

NOTE: This only occurs on the remote device and not in emulation.



RESOLUTION
Ensure that the Top and Left properties of the CommandBar control are both set to zero at design time and then set the position of the control at run time.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default. From the Project menu, select Components, and then select the Microsoft CE CommandBar Control. Add a CommandBar Control to Form1. Ensure that either the Top or Left property is set to a non-zero value.  Paste the following code into Form1: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) MsgBox "KeyCode= " & KeyCode End Sub

Private Sub Form_KeyPress(KeyAscii As Integer) MsgBox "KeyAscii= " & KeyAscii End Sub

'Private Sub Form_Load '   CommandBar1.Move 0, 0 'End Sub  Run the application, targeting the remote device. Ensure that Form1 is active, and then press a key on the keyboard. Note that two message boxes appear.</li> Uncomment the Form_Load event, and run the project again.</li> Ensure that Form1 is active, and then press a key on the virtual keyboard. Note that the message boxes no longer appear.</li></ol>

Additional query words: wce vbce vbce6 eVB

Keywords: kbbug kbnofix kbtoolkit KB255272

-

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

© Microsoft Corporation. All rights reserved.