• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

double right mouse click

What is the routine for detecting a double-right mouse click?
0
boatboy
Asked:
boatboy
  • 7
  • 3
  • 2
  • +1
1 Solution
 
cedricdCommented:
the dbl_click events
0
 
cedricdCommented:
private sub control_dbl_click()

end sub
0
 
boatboyAuthor Commented:
BUT WHAT IS THE CODE TO DIFFERENCIATE A RIGHT DOUBLE CLICK FROM A LEFT DOUBLE CLICK?
0
Technology Partners: 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!

 
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
 
dabelleiCommented:
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
 
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

Featured Post

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!

  • 7
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now