Dim m As Long Private Sub Command1_Click() Timer1.Enabled = ture m = Val(Text1.Text) * 60 Label1.Caption = "现在开始计时" Command1.Visible = False End Sub
Private Sub Timer1_Timer() m = m - 1 If m < 0 Then Timer1.Enabled = False MsgBox "时间到", 0, "标题" Label1.Caption = "请输入倒计时时间" Text1.Text = "" Command1.Visible = ture Exit Sub End If n1 = Format(m Mod 60, "00") n2=format((m 60)mod 60,"00:") n3=format(m 3600,"00:") Text1.Text = n3 & n2 & n1 Command1.Visible = False End Sub