VB中处理长列表框项的两种方法
日期:09-07  来源:
中国设计秀 作者:cnwebshow.com
但直接使用字体的大小属性来判断,不需要使用API函数,看一下下面的代码就明白了。可以使用下面的代码来替换上面的列表框鼠标移动事件代码: FFp中国设计秀
Private Sub List1_MouseMove FFp中国设计秀
(Button As Integer, Shift As Integer, _ FFp中国设计秀
X As Single, Y As Single) FFp中国设计秀
Dim Ypos As Integer, iOldFontSize As Integer FFp中国设计秀
iOldFontSize = Me.Font.Size FFp中国设计秀
Me.Font.Size = List1.Font.Size FFp中国设计秀
Ypos = Y Me.TextHeight("Xyz") + List1.TopIndex FFp中国设计秀
Me.Font.Size = iOldFontSize FFp中国设计秀
If Ypos < List1.ListCount Then FFp中国设计秀
List1.ToolTipText = List1.List(Ypos) FFp中国设计秀
Else FFp中国设计秀
List1.ToolTipText = "" FFp中国设计秀
End If FFp中国设计秀
End SubFFp中国设计秀