供参考一下
不知道错在哪里
应该是静态变量定义的问题
下面是代码
Private Sub Command1_Click()
If Command1.Caption = "开始" Or Command1.Caption = "继续" Then
Timer1.Enabled = True
Command1.Caption = "暂停"
Else
If Command1.Caption = "暂停" Then
Command1.Caption = "继续"
Timer1.Enabled = False
End If
End If
End Sub
Private Sub Form_Load()
Static i As Integer
For Each MyControl In Me
If TypeName(MyControl) = "Label" Then
MyControl.FontSize = 72
MyControl.Alignment = 2
End If
Next
For i = 0 To 7 Step 1
Label1(i).Caption = i + 1
Next i
End Sub
Private Sub Timer1_Timer()
Label1(i).BackColor = &HC0C0FF
i = ((i + 1) Mod 7) - 1
End Sub
望指教