[求助]如何用Timer组件做倒计时啊?
请问如何用Timer组件实现倒计时.....textbox里显示时间...每一秒改变一次!!!!!!!!!!
Sub time()
Dim h, m As Integer
h = Int(Session("时间") / 60)
m = Session("时间") - h * 60
hh = h : mm = m : ss = 0
Timer1.Interval = 1000
Dim t, msg As String
t = IIf(hh < 10, "0" & hh, "" & hh) & ":" & IIf(mm < 10, "0" & mm, "" & mm) & ":" & IIf(ss < 10, "0" & ss, "" & ss)
TextBox23.Text = t
ss = ss - 1
If hh = 0 And mm = 0 And ss = -1 Then
msg = "考试时间已到,请按 '交卷' 按钮提交答案!"
MsgBox(msg, 48, "注意")
End If
If ss = -1 And mm > 0 Then
mm = mm - 1 : ss = 59
End If
If mm = 0 And hh > 0 Then
hh = hh - 1 : mm = 59
End If
End Sub