这是我设计的一个VB倒计时程序,为什么无法结束? Dim hh, mm, ss Private Sub Form_Load() hh = 0: mm = 0: ss = 5
Timer1.Interval = 1000 End Sub Private Sub Timer1_Timer() s = IIf(ss < 10, "0" & ss, "" & ss)
m = IIf(mm < 10, "0" & mm, "" & mm)
h = IIf(hh < 10, "0" & hh, "" & hh) t = h & ":" & m & ":" & s
Me.Caption = 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
If mm = 0 And hh > 0 Then hh = hh - 1: mm = 59
End Sub
Timer1.Interval = 1000 End Sub Private Sub Timer1_Timer() s = IIf(ss < 10, "0" & ss, "" & ss)
m = IIf(mm < 10, "0" & mm, "" & mm)
h = IIf(hh < 10, "0" & hh, "" & hh) t = h & ":" & m & ":" & s
Me.Caption = 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
If mm = 0 And hh > 0 Then hh = hh - 1: mm = 59
End Sub
msg = "练习时间已到,按回车键结束!"
MsgBox msg, 48, "注意"
end '加这句
End If
me.timer1.enable=false
msg = "练习时间已到,按回车键结束!"
MsgBox msg, 48, "注意"
end '加这句
End If