我想当鼠标到达标签时标签背景颜色为紫色,当鼠标离开时还原为原来的颜色,于是,我在标签的“鼠标移动”事件中加入如下代码,但不能够达到目的,如何修改?
Private Sub Label0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label0.BackStyle = 1
Me.Label0.BackColor = 16751052
End Sub
Private Sub Label0_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label0.BackStyle = 0
End Sub
我建了一个函数,如下;
Public Function Move(a As Label)
a.BackStyle = 1
a.BackColor = 16751052
End Function
在“数据录入”标签的单击事件中写下如下代码:
move([label0 ])
运行时出错,提示找不到宏,请问,代码错在什么地方?