同一线程下的多个timer不能同时运作。示例程序: Private Sub Command1_Click() Label1.Caption = "0" Label2.Caption = "0" Timer1.Interval = 1 Timer2.Interval = 1 Timer1.Enabled = True Timer2.Enabled = True End Sub Private Sub Timer1_Timer() Do Label1.Caption = Label1.Caption + 1 DoEvents Loop End SubPrivate Sub Timer2_Timer() Do Label2.Caption = Label2.Caption + 1 DoEvents Loop End Sub
------------------------------
什么做的计时器?说清楚呀!
Timer1.Enabled = False
Timer2.Enabled = False
End SubPrivate Sub Timer1_Timer()
i = i + 1
Text1 = i
End Sub
Private Sub Timer2_Timer() j = j + 1
Text2 = i
End Sub
确实一会儿两文本框中的值就一样了
Private Sub Command1_Click()
Label1.Caption = "0"
Label2.Caption = "0"
Timer1.Interval = 1
Timer2.Interval = 1
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
Do
Label1.Caption = Label1.Caption + 1
DoEvents
Loop
End SubPrivate Sub Timer2_Timer()
Do
Label2.Caption = Label2.Caption + 1
DoEvents
Loop
End Sub