| 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_GETITEMHEIGHT = &H1A1 Private Sub List1_MouseMove(Button As Integer, _ Shift As Integer, X As Single, Y As Single) Dim ItemHeight As Long Dim NewIndex As Long Static OldIndex As Long With List1 ItemHeight = SendMessage(.hWnd, LB_GETITEMHEIGHT, 0, ByVal 0&) ItemHeight = .Parent.ScaleY(ItemHeight, vbPixels, vbTwips) NewIndex = .TopIndex + (Y \ ItemHeight) If NewIndex <> OldIndex Then If NewIndex < .ListCount Then .ToolTipText = .List(NewIndex) Else .ToolTipText = vbNullString End If OldIndex = NewIndex End If End With End Sub |
ListBox ToolTip tekst |
Express News India | Freelance ecommerce web development India