这是循环内的代码片段。这是一个倒计时钟。
如何为倒计时时钟添加额外时间?
我不明白为什么我只能添加额外的分钟或小时 通过说"分钟=分钟+ 20"例如。我是VB6的新手。遗憾!
Dim time_now As Date
Dim hours As Long
Dim minutes As Long
Dim seconds As Long
time_now = Now
If time_now >= m_StopTime Then
tmrWait.Enabled = False
lblRemaining.Caption = "0:00:00" 'Time has reached 0. Boom!
Else
这里我们将秒数分为秒,分钟,小时
seconds = DateDiff("s", time_now, m_StopTime)
minutes = seconds \ 60
seconds = seconds - minutes * 60
hours = minutes \ 60
minutes = minutes - hours * 60
现在我们显示结果
lblRemaining.Caption = _
Format$(hours) & ":" & _
Format$(minutes, "00") & ":" & _
Format$(seconds, "00")
结束如果