请参考: http://zhidao.baidu.com/question/38046715.html 编程中国-北京2008年奥运会倒计时 http://www.bc-cn.net/code/asp/others/2420.html 或者: 新建 工程,1个按钮,1个timer,和1个文本框 在文本框内输入时间(秒数),点按钮就开始倒计时了: Dim i% Private Sub Command1_Click() Command1.Caption = IIf(Command1.Caption = "开始计时", "停止计时", "开始计时") Timer1.Enabled = Not Timer1.Enabled i = 0 End Sub Private Sub Form_Load() Timer1.Enabled = False Timer1.Interval = 1000 Command1.Caption = "开始计时" Text1 = "" End Sub Private Sub Timer1_Timer() If Text1 = "" Then Exit Sub Cls If Val(Text1) - i = 0 Then Print "时间到!!!" Timer1.Enabled = False Exit Sub End If Print "现在还剩下" & Val(Text1) - i & "秒了!!" i = i + 1 End Sub
编写一个VB做的天数倒计时程序:
datediff("d",now,#2009/10/1#)
d
代表天数
datediff表示时间间隔