vb怎么写个一小时倒计时,过了时间到了执行msgbox"一小时到了"
我填上1小时或60秒或10分钟钟这样的时间!时间一到就msgbox“时间到了”
vb怎么写个一小时倒计时,过了时间到了执行msgbox"一小时到了"
我填上1小时或60秒或10分钟钟这样的时间!时间一到就msgbox“时间到了”
以前写的一个,你看看
Dim T As Long
Private Sub Command1_Click()
Timer1.Enabled = True
Label5.Caption = Val(Text1.Text \ 60)
Label7.Caption = Val(Text1.Text Mod 60)
End Sub
Private Sub Form_Load()
Label1.Caption = "00:00"
Label5.Caption = "00"
Label7.Caption = "00"
Timer1.Interval = 1000
Timer1.Enabled = False
End Sub
Private Sub Text1_Change()
T = Val(Text1.Text)
End Sub
Private Sub Timer1_Timer()
T = T - 1
Label1.Caption = Str(Int(T / 60)) + ":" + Str(T - Int(T / 60) * 60)
If T = 0 Then
MsgBox "时间已到!"
Timer1.Enabled = False
End
End If
End Sub