比如一label1,鼠标移到上面时要改变它的背景色,用如下语句: Private Sub Label1_MouseMove(button As Integer, shift As Integer, x As Single, y As Single) Label1.BackColor = vbRed'鼠标移到这个label1控件上时背景色变为红色 End Sub 当鼠标移走后, Private Sub Form1_MouseMove(button As Integer, shift As Integer, x As Single, y As Single) Label1.BackColor = vbBlue'当鼠标移走时背景色变为蓝色 End Sub
在mouse_move里写代码
Private Sub Label1_MouseMove(button As Integer, shift As Integer, x As Single, y As Single)
Label1.BackColor = vbRed'鼠标移到这个label1控件上时背景色变为红色
End Sub
当鼠标移走后,
Private Sub Form1_MouseMove(button As Integer, shift As Integer, x As Single, y As Single)
Label1.BackColor = vbBlue'当鼠标移走时背景色变为蓝色
End Sub