Solved

double right mouse click

Posted on 1998-12-02
14
259 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now