|
我试过在标签的MouseMove Event事件里调整它的颜色,当鼠标移动到一个标签时,一点也不起作用,请问有没有更好的方法?
Private Sub LbMain_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
Dim i As Integer, iLeft As Long, iRight As Long, iTop As Long, iBottom As Long
i = Index
iLeft = LbMain(i).Left
iRight = LbMain(i).Left + LbMain(i).Width
iTop = LbMain(i).Top
iBottom = LbMain(i).Height + LbMain(i).Top
If x > iLeft And x < iRight And Y > iTop And Y < iBottom Then
LbMain(i).ForeColor = vbBlue
Else
LbMain(i).ForeColor = vbBlack
End If
End Sub
|
|