Dim a As Integer Private Sub Command1_Click() Timer1.Enabled = True Timer1.Interval = 500 End Sub Private Sub Command2_Click() Timer1.Enabled = False Timer start End Sub Private Sub Timer1_Timer() a = a + 1 Text1 = a End S... Dim a As Integer
Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 500
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Timer start
End Sub
Private Sub Timer1_Timer()
a = a + 1
Text1 = a
End Sub
Private Sub Timer1_Timer()
if flag=1 then
a=0
end if
a = a + 1
Text1 = a
End Sub
在通用声明处写 dim flag
再添个按钮,click里编写 flag=1 此后当点这个按钮a的值就从0开始了,也就是重新开始计时了