Link to home
Start Free TrialLog in
Avatar of boatboy
boatboy

asked on

double right mouse click

What is the routine for detecting a double-right mouse click?
Avatar of cedricd
cedricd

the dbl_click events
private sub control_dbl_click()

end sub
Avatar of boatboy

ASKER

BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
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
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.
Avatar of boatboy

ASKER

BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
Avatar of boatboy

ASKER

CEDRICD RESPONDED FIRST BUT ONLY STATED TO USE THE DBL CLICK EVENT WHICH IS TOO VAGUE AND INCOMPLETE.  

DABELLEI PROVIDED THE MOST COMPLETE ANSWER.  
Avatar of boatboy

ASKER

DABELLEI RESPOND AGAIN TO RECEIVE YOUR POINTS ON DETECTING A DOUBLE-RIGHT CLICK.
Avatar of boatboy

ASKER

DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
Avatar of boatboy

ASKER

DABELLEI, RESPOND AGAIN

MARK@MDSI-USA.COM
ASKER CERTIFIED SOLUTION
Avatar of dabellei
dabellei

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

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...
Avatar of boatboy

ASKER

.