VB6.0 label 指针移过的时候字就变颜色,还加了下划线
发布网友
发布时间:2024-10-16 06:48
我来回答
共1个回答
热心网友
时间:2024-12-05 20:28
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = &HFF&
Label1.FontUnderline = True
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Label1.FontUnderline = False
Label1.ForeColor = &H0&
End Sub鼠标移入时字体变色和加上下划线,移出时恢复颜色和去除下划线。msgbox“”写在Label1_MouseMove事件里,鼠标移入时触发Label1_MouseMove事件当然会弹出msgbox“”。要想不让它弹出就把它写在别的事件里,或加个判断,当条件满足时再弹出对话框。