| There's a bug (Q180833)
in the VBCE ListBox control that allows the Double Click event to fire when there are no
items in the ListBox. Normally in VB, the Double Click event does not fire if there are no
items in the ListBox. Normally, it is safe to assume that there will be a valid (greater
than -1) ListIndex value of the ListBox while in the Double Click event. To prevent application errors, you should add the
following check to the DoubleClick event if you are going to be doing anything in the
DoubleClick event:
Private Sub List1_DblClick()
If List1.ListIndex = -1 Then Exit Sub
List1.RemoveItem List1.ListIndex
End Sub |
 |
 |
 |
When the bugs get tough,
the tough get coding! |
|