Microsoft KB Archive/77738

= BUG: Extra Click Event If Double-Click When Mouse Button Down =

Article ID: 77738

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition
 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q77738



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 &quot;Click&quot; End Sub   Enter the following code in the Form_DblClick event procedure: Private Sub Form_DblClick Print &quot;DblClick&quot; 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 &quot;Down&quot;; 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 &quot;Up&quot;; Button End Sub  From the Run menu, choose Start.</li> 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

</li> Press and hold the left mouse button. The output to Form1 should be:

Down 1

</li> 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

</li></ol>

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: kbbug KB77738

-

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

© Microsoft Corporation. All rights reserved.