Dim n As Integer
Private Sub Timer1_Timer()
If n = 3 Then
n = 1
Else
n = n + 1
End If
Select Case n
Case 1
Label1.Caption = "G"
Label1.ForeColor = vbRed
Label2.Caption = "G"
Label2.ForeColor = vbGreen
Label3.Caption = "I"
Label3.ForeColor = vbGreen
Timer1.Interval = 1000
Case 2
Label1.Caption = "G"
Label1.ForeColor = vbGreen
Label2.Caption = "G"
Label2.ForeColor = vbRed
Label3.Caption = "I"
Label3.ForeColor = vbGreen
Timer1.Interval = 1000
Case 3
Label1.Caption = "G"
Label1.ForeColor = vbGreen
Label2.Caption = "G"
Label2.ForeColor = vbGreen
Label3.Caption = "I"
Label3.ForeColor = vbRed
Timer1.Interval = 1000
End Select
End Sub
No comments:
Post a Comment
Note: only a member of this blog may post a comment.