MSFlexGrid MouseUp

I need to know how to determine the current row when a user right click's on a cell to bring up a pop up menu.

Currently I am using the "MouseUp" function and tried returning the row with ".row", but it doesn't return the current row.

Thank you for your help.
LVL 4
ckosloskiAsked:
Who is Participating?
 
Info_user100Connect With a Mentor Commented:
You can use mouseRow as a read only property. You can also use MouseCol to
get the col value. It will point to currently clickeed cell coordinates.
0
 
Erick37Commented:
Try this:


Private Sub MSFlexGrid1_MouseUp(Button As Integer, _
        Shift As Integer, x As Single, y As Single)
    Dim i As Integer
    With MSFlexGrid1
    For i = 0 To .Rows - 1
        If y < .RowPos(i) Then Exit For
    Next
    End With
    Debug.Print "Clicked on row " & Val(i - 1)
End Sub
0
 
Erick37Commented:
Ah yes, the MouseRow property! Much better.
0
 
ckosloskiAuthor Commented:
The MouseRow property worked great!!!  Enjoy your points.
0
 
Info_user100Commented:
Thanks and have a great happy new year.
0
All Courses

From novice to tech pro — start learning today.