JEGB
asked on
Detecting Right Mouse Button Event
I have a VSFlexGrid which when the user clicks the right mouse button brings up a pop-up menu. I need to know what column the user was in when they performed the mouse click but the right mouse button event does not cause a click event in the grid. I need to know either a) how to generate the event by using the right mouse button or b) simulate a left mouse button click to fire up the event.
if there is a mouse down event then there is a variable passed that tells you which button has been pressed.
Sub Grid1_MouseDown (Button As Integer, X As Single, Y As Single..)
If (Button = vbRightButton) Then
'Show the popupmenu here
End If
End Sub
If (Button = vbRightButton) Then
'Show the popupmenu here
End If
End Sub
ASKER
To clarify: If you click the Left Mouse button in a VSFlexGrid the Row and Col properties change to the new cell (row and col) properties that the mouse cursor is in when the event occurred. However if you click the right mouse button in a cell you can detect the event BUT the col and row properties do not change but instead remain what they were before the event. I need to know a way of detecting what column the mouse is in when the right mouse button event occurs.
ASKER
I have this Q answered on another Question I've posted, basically you use the MouseRow and MouseCol properties, which I must have missed while scanning the help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.