Mousemove event in listbox

How can I relate the X and Y coordinates of the mouse move to rows and/or columns?

https://documentation.xojo.com/index.php/ListBox.RowFromXY

[code]Sub MouseMove(X As Integer, Y As Integer)
dim row, col as Integer
row = Me.RowFromXY(x, y)
col=Me.ColumnFromXY(x, y)

me.HelpTag = "Row: " + str(row) + chr(32) + "Column: " + str(Col)

End Sub[/code]

But the Helptag does not show… How come (Windows)?

You will need to handle the helptag slightly differently:

[code]Sub MouseMove(X As Integer, Y As Integer)
dim row, col as Integer
row = Me.RowFromXY(x, y)
col=Me.ColumnFromXY(x, y)

Dim str as String = "Row: " + str(row) + chr(32) + "Column: " + str(Col)
If me.HelpTag <> str then
me.HelpTag = str
End If

End Sub[/code]

Works like a charm! Many thanks!

HMMMM… doesn’t work for me :frowning: [OSX]

  Dim row As Integer
  Dim col As Integer
  Dim s As String
  row=Me.RowFromXY(x,y)
  col=Me.ColumnFromXY(x,y)
  If row<0 Or row>=Me.listcount Then Exit Sub
  s=Me.cell(row,col)
  If s="" Then Exit Sub
  If Me.HelpTag<>s Then 
    Me.HelpTag=s
  End If

And yes, S does get populated… and never shows

I added Window1.title=“Helptag=”+s

and the window title changes, but still the helptag doesn’t show

Actually I got it to “kinda” work.

  1. Had to define a dummy helptag in the Inspector to get anything to happen.
  2. It only shows the FIRST row/cell tag it… I have to move the mouse OUT of the listbox and back into another cell to get that cells helptag :frowning:

Have you tried the new CellHelpTag?

No I had not… but when I did… IT WORKED PERFECTLY… sweet… Thanks (who said you can’t teach an old dog new tricks : )

That counts only for OLD dogs, you are FAR too young. :smiley:

LOL… guess our definition of old is different… ok…perhaps I am only approaching “old”… I turn 58 in a mere 11 days :frowning:

I am almost 65 and still feel not old, so you are extremely young in my perception! :wink: