GU_mr_Sand_Man
Board Regular
- Joined
- May 26, 2004
- Messages
- 88
Hello. I am trying to get a small dialog box to pop up when an entry in a listbox is highlighted with the mouse. I believe I need to use the hittest method to make this work. Here's my code thus far:
When I run this, I get a compile error, "Method or data member not found". How can I resolve this? Also, for my purposes, is the above code correct? Any help would be greatly appreciated.
Code:
Private Sub lstDistrict_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Item As Object
Set Item = lstDistrict.HitTest(X, Y)
If Not (Item Is Nothing) Then
Me.Caption = Item.Text
Else
Me.Caption = ""
End If
End Sub
When I run this, I get a compile error, "Method or data member not found". How can I resolve this? Also, for my purposes, is the above code correct? Any help would be greatly appreciated.