VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Retrieving the Item in a Listbox the mouse is currently over.

Jon B. Mooty  (4 Submissions)   Miscellaneous   Visual Basic 3.0   Advanced   Wed 3rd February 2021

As you move your mouse pointer over top of a listbox this code will return the index and select the item underneath it.

API Declarations
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_GETITEMRECT = &H198
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
'You will also need a ListBox named List1

Rate Retrieving the Item in a Listbox the mouse is currently over. (2(2 Vote))
Retrieving the Item in a Listbox the mouse is currently over..bas

Retrieving the Item in a Listbox the mouse is currently over. Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters