Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

double right mouse click

Posted on 1998-12-02
14
Medium Priority
?
315 Views
Last Modified: 2010-05-03
What is the routine for detecting a double-right mouse click?
0
Comment
Question by:boatboy
  • 7
  • 3
  • 2
  • +1
14 Comments
 
LVL 2

Expert Comment

by:cedricd
ID: 1447811
the dbl_click events
0
 
LVL 2

Expert Comment

by:cedricd
ID: 1447812
private sub control_dbl_click()

end sub
0
 

Author Comment

by:boatboy
ID: 1447813
BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:dabellei
ID: 1447814
Here's how to do it

Public right_mouse As Integer

Private Sub Form_DblClick()
    If right_mouse Then
        'do what ever you want here
    End If
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
        right_mouse = True
    End If
End Sub


If you like my answer then just repost it for me
0
 
LVL 3

Expert Comment

by:vikiing
ID: 1447815
Together with DblClick event, you must use MouseUp and/or MouseDown. It's only inside it where you receive an integer value whose bits tell you what button was pressed.
0
 

Author Comment

by:boatboy
ID: 1447816
BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
0
 

Author Comment

by:boatboy
ID: 1447817
CEDRICD RESPONDED FIRST BUT ONLY STATED TO USE THE DBL CLICK EVENT WHICH IS TOO VAGUE AND INCOMPLETE.  

DABELLEI PROVIDED THE MOST COMPLETE ANSWER.  
0
 

Author Comment

by:boatboy
ID: 1447818
DABELLEI RESPOND AGAIN TO RECEIVE YOUR POINTS ON DETECTING A DOUBLE-RIGHT CLICK.
0
 

Author Comment

by:boatboy
ID: 1447819
DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
0
 

Author Comment

by:boatboy
ID: 1447820
DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
0
 
LVL 2

Accepted Solution

by:
dabellei earned 200 total points
ID: 1447821
Public right_mouse As Integer

Private Sub Form_DblClick()
    If right_mouse Then
        'do what ever you want here
    End If
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
        right_mouse = True
    End If
End Sub

0
 
LVL 3

Expert Comment

by:vikiing
ID: 1447822
Deballei:

    Please, let me correct your code.

a) Variable "Right_Mouse" is not initialized; thus, once right button occurs, it will be True forever (there's nothing which sets variable to FALSE).

b) Variable "Button" (in Mouse events) is a binary-coded one, where there are several bits with different meaning. The way you code is valid ONLY if you want to check that bit <1> is set at "Button" AND ALL OTHERS are cleared.

A simple way to correct both problems would be:
    Right_Mouse=(Button and 2)<>0

0
 
LVL 2

Expert Comment

by:cedricd
ID: 1447823
Your question was also vague, you didn't precise where you want to use the dbl click.
the dbl click can be detected for all control using this events.
This events is started only when it's a dbl right click. (this is more simple then program a routine and execute the click events or the mouse down events ! )

so be it...
0
 

Author Comment

by:boatboy
ID: 1447824
.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question