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

ID: Q77738


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

  1. Start a new project in Visual Basic.


  2. 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 


  3. Enter the following code in the Form_DblClick event procedure:
    
       Private Sub Form_DblClick ()
          Print "DblClick"
       End Sub 


  4. Enter the following code in the Form_MouseDown event procedure:


  5. 
       ' 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 
  6. Enter the following code in the Form_MouseUp event procedure:


  7. 
       ' 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 
  8. From the Run menu, choose Start.


  9. 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


  10. Press and hold the left mouse button. The output to Form1 should be:
    Down 1


  11. 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.



Additional query words:

Keywords : buglist2.00 buglist3.00 kbvbp100bug PrgCtrlsStd
Version : 1.0 2.0 3.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: August 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.