添加一个Timer1定时器 3个文本框个别输入 时 分 秒
在timer事件中判断递减的时间是否小于等于 0 执行Shutdown
Private Sub Timer1_Timer()
On Error Resume Next
ElapTm = GetTickCount - StartTm '经过的时间为现在的时间减去开始的时间
LeftTm = Val(Text1.Text) * 1000 - ElapTm '设定的时间乘以毫秒后减去已经过的时间得到剩馀几毫秒
Me.Caption = "时间尚馀: " & Format(CStr(LeftTm / 1000), "0.000") & " 秒" '除以1000是因为这个API单位为毫秒
If LeftTm <= 0 Then '如果剩馀时间小於或等於0
Timer1.Enabled = False '设定定时器不可用
Me.Caption = "煮咖啡计时器"
Command1.Caption = "开始计时"
StartTm = GetTickCount
For i = 1 To 3
Call PlayVoice(AppDisk & "Beep.wav")
Call DlyTm(1000)
Next i
Call PlayVoice(AppDisk & "水烧干了.wav")
End If
End Sub