double right mouse click

What is the routine for detecting a double-right mouse click?
boatboyAsked:
Who is Participating?
 
dabelleiConnect With a Mentor Commented:
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
 
cedricdCommented:
the dbl_click events
0
 
cedricdCommented:
private sub control_dbl_click()

end sub
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
boatboyAuthor Commented:
BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
0
 
dabelleiCommented:
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
 
vikiingCommented:
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
 
boatboyAuthor Commented:
BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
0
 
boatboyAuthor Commented:
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
 
boatboyAuthor Commented:
DABELLEI RESPOND AGAIN TO RECEIVE YOUR POINTS ON DETECTING A DOUBLE-RIGHT CLICK.
0
 
boatboyAuthor Commented:
DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
0
 
boatboyAuthor Commented:
DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
0
 
vikiingCommented:
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
 
cedricdCommented:
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
 
boatboyAuthor Commented:
.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.