by Shadab Azeem Rahil (8 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 6th July 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Shows the text property of a listbox in the tooltip property, when the mouse hovers over the listbox for a second. Relies on the SendMessage
API Declarations
'[email protected]
'http://www.akaaz.cjb.net
Single, Y As Single, ListBox As ListBox) As String
Dim lXPoint As Long
Dim lYPoint As Long
Dim lIndex As Long
'
If Button = 0 Then ' No button was pressed
lXPoint = CLng(X / Screen.TwipsPerPixelX)
lYPoint = CLng(Y / Screen.TwipsPerPixelY)
With ListBox
lIndex = SendMessage(.hWnd, LB_ITEMFROMPOINT, 0, ByVal ((lYPoint * 65536) + lXPoint))
If (lIndex >= 0) And (lIndex <= .ListCount) Then .ToolTipText=".List(lIndex)" 'Return the text=".list(lIndex)" Else .ToolTipText 'Return nothing
End If
End With
End If
End Function
No comments have been posted about Shows the text property of a listbox in the tooltip property, when the mouse hovers over the listbo. Why not be the first to post a comment about Shows the text property of a listbox in the tooltip property, when the mouse hovers over the listbo.