Rem === 使用元件:Timer1,Shape1,Label1 Dim N As Integer
Private Sub Form_Load() Timer1.Enabled = True Timer1.Interval = 1000 '1秒鐘 Shape1.FillColor = RGB(255, 0, 0) N = 10 Label1.Caption = N End Sub
Private Sub Timer1_Timer() If N = 1 Then If Shape1.FillColor = RGB(0, 255, 0) Then Shape1.FillColor = RGB(255, 0, 0) Else Shape1.FillColor = RGB(0, 255, 0) End If N = 11 End If N = N - 1 Label1.Caption = N End Sub