The information in this article applies to:
- Standard and Professional Editions of Microsoft Visual Basic for
Windows, versiona 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0
SYMPTOMS
When one mouse button is held down, double-clicking the other button
generates one more Click event than necessary. The problem does not occur
when double-clicking either mouse button individually.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
MORE INFORMATION
The following code demonstrates that an extra Click event is generated
when double-clicking one mouse button while holding the other down.
Steps to Reproduce Problem
- Start a new project in Visual Basic.
- Double-click the form or press the F7 key to bring up the code window.
Enter the following code in the Form_Click event procedure for Form1:
Private Sub Form_Click ()
Print "Click"
End Sub
- Enter the following code in the Form_DblClick event procedure:
Private Sub Form_DblClick ()
Print "DblClick"
End Sub
- Enter the following code in the Form_MouseDown event procedure:
' Enter the following two lines as one, single line:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Print "Down"; Button
End Sub
- Enter the following code in the Form_MouseUp event procedure:
' Enter the following two lines as one, single line:
Private Sub Form_MouseUp(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Print "Up"; Button
End Sub
- From the Run menu, choose Start.
- Using the right mouse button, double-click anywhere on the form. The
output to Form1 should be:
Down 2
Up 2
Click
DblClick
Up 2
- Press and hold the left mouse button. The output to Form1 should be:
Down 1
- While holding the left mouse button down, double-click with the right
mouse button. The output to Form1 should be:
Down 2
Up 2
Click
DblClick
Up 2
Click
The last Click was not generated when double-clicking with the right mouse
button alone (as illustrated in step 8 above). This additional call to the
Click event procedure is not expected behavior and is a problem with Visual
Basic. The problem also occurs when the right mouse button is held down and
you double-click the left mouse button.
Keywords : buglist3.00 PrgCtrlsStd buglist1.00 buglist2.00 kbbuglist kbtlc
Version : 1.0 2.0 3.0
Platform : WINDOWS
Issue type : kbbug
|