Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ms flex grid - right click? 1

Status
Not open for further replies.

jtseltmann

Programmer
Jan 15, 2002
149
US
I have an ms flex grid that I am trying to figure out how or if I can get the right click event to move the col/row position to the cursor.

What I have now is a floating menu that popups up when the user right clicks on the flx grid col 0. The menu opens at the cursor point. The idea being that a user would right click, open the menu and perform a process based on the value in the col/row selected. The problem is that the unless the user left clicks to select the row and then right clicks...the cursor pos is not moved to that row/col. The menu opens and sets the value based on where the 'selection' is.

Is there anyway to get the flex grid to recognize the right click as it does a left click?

I have my code working now so I can make it a requirement to left click to select the row and then right click to perform the task. I can live with that if I have to but...

I have tried lots of things and my search/research has turned up nothing. Thanks for any direction or a yes/no if it can't be done. I don't need anyone to write it for me but some direction would help! I'll keep trying in the meantime.
Thanks all!
 
Private Sub FlexGrid_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = vbRightButton Then
.
.
.
.
End If
 
JerryKlmns,
I have this code working fine. I know how to trap the event and perform what I want when the right click is made the problem is that the .row/.col of the grid are not set unless a left click is made. So, by left clicking a row you have not 'set' the pos in the grid that I need before the menu is displayed.

does this help?

The idea is that I need the row to be selected and then open the menu by performing a right click...

thanks!!!
 
Use .MouseRow to determine which row is selected with a right click, and .Row to set.

HTH

TazUk

[pc] Blue-screening PCs since 1998
 
TazUk,
Thank you! that was the one I missed...problem solved.

Always great answers/help from this group.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top