采用颤兆Timer控察肢件,设置Timer1.Interval = 0
当点击button1时,Timer1.Interval = 1000 (1000=1秒)
直接给你代败洞世码吧
Dim a As Long
Private Sub Command1_Click()
If Timer1.Interval = 1000 Then
Timer1.Interval = 0
MsgBox "经过了" & CStr(a) & 秒钟
Else
Timer1.Interval = 1000
End If
a = 0
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Time
a = a + 1
End Sub