VB怎样实现Label鼠标经过变色?
请问在VB中怎样实现Label控件在鼠标经过时变换颜色,鼠标移开时又变回原来的原色呢?比如本原字体是蓝色的,当鼠标经过LABEL控件时,LABEL里面的字符变成黄色,当鼠...
请问在VB中怎样实现Label控件在鼠标经过时变换颜色,鼠标移开时又变回原来的原色呢?比如本原字体是蓝色的,当鼠标经过LABEL控件时,LABEL里面的字符变成黄色,当鼠标移出LABEL控件的范围后又变回原来的蓝色,希望各位前辈能帮忙写下这段程序,谢谢!!!
展开
2个回答
展开全部
Private Sub Form_Load()
Label1.ForeColor = vbBlue
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label1.ForeColor = vbYellow Then Label1.ForeColor = vbBlue
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbYellow
End Sub
Label1.ForeColor = vbBlue
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label1.ForeColor = vbYellow Then Label1.ForeColor = vbBlue
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbYellow
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询