Dim s, m, h As Integer
Private Sub Command1_Click()
Timer1.Interval = 1000
Timer1.Enabled = True
s = Val(Text1.Text)
h = Int(s / 3600)
m = Int(s / 60)
s = s Mod 60
End Sub
Private Sub Timer1_Timer()
If s <= 0 Then
If m <= 0 Then
If h <= 0 Then
Timer1.Enabled = False
MsgBox "时间到"
Else
h = h - 1
End If
Else
m = m - 1
End If
Else
s = s - 1
End If
Label1.Caption = Format(h, "00") & ":" & Format(m, "00") & ":" & Format(s, "00")
End Sub
[[it] 本帖最后由 爬树的猪 于 2008-4-20 20:29 编辑 [/it]]