FIX: An Empty ListBox Generates a DoubleClick Event

ID: Q180833


The information in this article applies to:


SYMPTOMS

Double-clicking on an empty ListBox fires the DoubleClick event. The DoubleClick event is not supposed to fire when the ListBox is empty.


RESOLUTION

To work around the issue, add code to the DoubleClick event to detect an empty ListBox, and then exit the procedure as follows:


   Private Sub List1_DblClick()
     If List1.ListCount = 0 Then Exit Sub
     MsgBox "doubleclick" 'this line won't execute when empty.
   End Sub 


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

This problem was corrected in Windows CE Toolkit for Visual Basic 6.0.

Additional query words: vbce5 vbce6vbce


Keywords          : kbToolkit kbVBp kbVBp500bug kbVBp600fix kbWinCE kbWinCE100 kbGrpVB 
Version           : WINDOWS:1.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: February 25, 1999