急求一个2分钟的计时器

2024-11-27 12:26:04
推荐回答(2个)
回答1:

放一个Timer,一个Label
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
label1.Caption = "120"
End Sub

Private Sub Timer1_Timer()
Dim t As Integer
t = Val(label1.Caption)
t = t - 1
If t > 0 Then
label1.Caption = t
Else
Timer1.Enabled = False
End If
End Sub

回答2:

窗体上放一个时间控件timer1

Private Sub Form_Load()
Timer1.Interval = 120000
Timer1.Enabled = True
End Sub