Hi,
is it possible to display the tooltip of an item in a list box without selecting the item, ie. hovering above the item?
Thanks.
Printable View
Hi,
is it possible to display the tooltip of an item in a list box without selecting the item, ie. hovering above the item?
Thanks.
Look at This Thread
If you can't figure out how to apply it to what you want, post again and i'll explain it.
No, thats not what I'm looking for. It doesnt help. I need to use the MouseMove event or something similar.
anyone else?
VB Code:
Private Type POINTAPI x As Long y As Long End Type Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long 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 Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long Private Const LB_GETITEMRECT = &H198 Private Const LB_ITEMFROMPOINT = &H1A9 Public Function ItemFromPoint(ByRef oList As ListBox, ByVal x As Single, ByVal y As Single) As Long Dim tPOINT As POINTAPI Dim iIndex As Long 'Get the Mouse Cursor Position Call GetCursorPos(tPOINT) 'Convert the Coords to be Relative to the Listbox Call ScreenToClient(oList.hwnd, tPOINT) 'Find which Item the Mouse is Over iIndex = SendMessage(oList.hwnd, LB_ITEMFROMPOINT, 0&, ByVal ((tPOINT.x And &HFF) Or (&H10000 * (tPOINT.y And &HFF)))) 'Extract the List Index ItemFromPoint = iIndex And &HFF End Function Private Sub Form_Load() Dim iIndex As Integer For iIndex = 1 To 100 List1.AddItem iIndex & " blankdata " & iIndex Next End Sub Private Sub List1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Dim iIndex As Long Static iLastIndex As Long iIndex = ItemFromPoint(List1, x, y) Me.List1.ToolTipText = Me.List1.List(iIndex) End Sub
good luck
:cool:
Exactly.
Just what the thread I was pointing you to was doing.
:)
gotta learn to read between the lines.
Thanks tokersball!!
Dalceon, thanks for trying to help, but your thread was nothing like what tokersball placed.