VB编程中,PictureBox背景颜色变化
当鼠标经过PictureBox1时,背景颜色发生变化,若是不点击该PictureBox1,则当鼠标移走后变回原色,若是点击该该PictureBox1,则背景颜色变成另外的...
当鼠标经过PictureBox1时,背景颜色发生变化,若是不点击该PictureBox1,则当鼠标移走后变回原色,若是点击该该PictureBox1,则背景颜色变成另外的颜色,此时鼠标移了颜色也不发生变化......具体怎么实现???
展开
1个回答
展开全部
Dim C As Long
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Picture1.BackColor <> C Then Picture1.BackColor = C
End Sub
Private Sub Picture1_Click()
Picture1.BackColor = QBColor(5)
C = Picture1.BackColor
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.BackColor = QBColor(10)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Picture1.BackColor <> C Then Picture1.BackColor = C
End Sub
Private Sub Picture1_Click()
Picture1.BackColor = QBColor(5)
C = Picture1.BackColor
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.BackColor = QBColor(10)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询