郁闷啊,请问大侠们怎么实现用一个LABEL控件和一个时钟控件完成LABEL的背景颜色慢慢由红变深红达到一定程度再由慢慢由绿变成深绿,然后再慢慢由蓝变成深蓝,然后再由红变深红.....................................如此循环下去,靠,我弄了三天都没弄出来,真是没脾气,在这请教各位大侠了.在下感激啊,
下面是我编的一些代码但是不行,不知道哪里错了.
Dim a As Long
Dim b As Long
Private Sub Command1_Click()
Timer1.Enabled = True
a = Timer
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Label1.BackColor = RGB(b, 100, 100) Or RGB(100, 100, b) Or RGB(100, b, 100)
End Sub
Private Sub Timer1_Timer()
Dim b As Long
b = (Timer - a) * 100
Text1.Text = b
b = (Timer - a) * 100
' Label1.BackColor = RGB(b, 100, 100)
If Label1.BackColor = RGB(1000, 100, 100) Then
Command1_Click
b = (Timer - a) * 100
Label1.BackColor = RGB(100, 100, 100)
End If
If Label1.BackColor = RGB(100, 1000, 100) And b > 1000 Then
Command1_Click
b = (Timer - a) * 100
Label1.BackColor = RGB(100, 100, b)
End If
If Label1.BackColor = RGB(100, 100, 1000) And b > 1000 Then
Command1_Click
b = (Timer - a) * 100
Label1.BackColor = RGB(b, 100, 100)
End If
End Sub