2#方漠
图片中的代码复制如下:
Private Sub Listbox1_MouseMove
(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Ypos As Integer, iOldFontSize As Integer
iOldFontSize = Me.Font.Size
Me.Font.Size = Listbox1.Font.Size
Ypos = Y \ Me.TextHeight("Xyz") + Listbox1.TopIndex
Me.Font.Size = iOldFontSize
If Ypos < Listbox1.ListCount Then
Listbox1.ToolTipText = Listbox1.List(Ypos)
Else
Listbox1.ToolTipText = ""
End If
End Sub