vb6.0时间倒计时器

要带倒计时时间显示,两个command分别代表开始结束,倒计时间为3分钟

'窗体加入1个文体框,2个命令按钮,1个标签 和1个时间控件
'这个用到了DateDiff函数,我觉得这个应该能满足你的要求
Option Explicit
Dim n As Long
Dim dt As Date
Dim date1 As Date
Dim date2 As Date

Private Sub Command1_Click()
Timer1.Enabled = False
End Sub

Private Sub Command2_Click()
date1 = Time
date2 = Format(Text1.Text, "hh:mm:ss")
dt = date1 + date2
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub

Private Sub Form_Load()
Text1.Text = "00:03:00"
Command1.Caption = "停止"
Command2.Caption = "开始"
End Sub

Private Sub Timer1_Timer()
n = DateDiff("s", Time, dt)
Label1 = Format(TimeSerial(0, 0, n), "hh:mm:ss")
If n = 0 Then End
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-11-10
呵呵,这么巧,我做过一个4分钟的。
=》http://hi.baidu.com/47okey/blog/item/221785c30cc3b129e4dd3b63.html
不过,我的开始和结束用的是LABEL控件。你可以参考一下。
第2个回答  2011-11-10
用标签显示出来,CAPTION=180,每秒使标签的caption-1
相似回答