BUG: VBCE: Clicking ComboBox May Trigger Command Click Event (248070)



The information in this article applies to:

  • Microsoft Windows CE Toolkit for Visual Basic 6.0

This article was previously published under Q248070

SYMPTOMS

When selecting an item from a combo box, the Click event for a command button may fire. This happens on command buttons having shortcut keys and is related to the relative TabIndex values between the command button and the combo box.

RESOLUTION

To prevent the problem remove the shortcut keys from the command buttons. Modifying the TabIndex property of the combo box and ensuring that it does not have the highest TabIndex value on the form works in some cases without removing the shortcut keys.

STATUS

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

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Windows CE project in either Visual Basic or eMbedded Visual Basic. Form1 is created by default.
  2. Add a ComboBox to Form1.
  3. Add a Command Button to Form1. Set its Caption to "&Save".
  4. Paste the following code into Form1:
       Private Sub Command1_Click()
           MsgBox "In Command1_Click"
       End Sub
    
       Private Sub Form_Load()
           Combo1.AddItem "Test"
       End Sub
    					
  5. Run the application.
  6. Drop-down the combo box and click Test. The Click event for the command button will fire.

Modification Type:MajorLast Reviewed:10/2/2003
Keywords:kbBug kbpending kbToolkit KB248070