3个回答
展开全部
'一个timer1,一个Command1
Dim lng1 As Long
Private Sub Command1_Click()
Timer1.Enabled = True
lng1 = 30
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = False
Command1.Caption = "倒计时30秒"
End Sub
Private Sub Timer1_Timer()
lng1 = lng1 - 1
If lng1 = 0 Then
MsgBox "时间到啦!"
Else
Command1.Caption = "倒计时" & lng1 & "秒"
End If
End Sub
Dim lng1 As Long
Private Sub Command1_Click()
Timer1.Enabled = True
lng1 = 30
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = False
Command1.Caption = "倒计时30秒"
End Sub
Private Sub Timer1_Timer()
lng1 = lng1 - 1
If lng1 = 0 Then
MsgBox "时间到啦!"
Else
Command1.Caption = "倒计时" & lng1 & "秒"
End If
End Sub
展开全部
Private Sub Form_Load()
Label1.Caption = 10 '改成你喜欢的数(秒)
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Val(Label1.Caption) - 1
If Label1.Caption = "0" Then
MsgBox "时间到"
Timer1.Enabled = False
End If
End Sub
Label1.Caption = 10 '改成你喜欢的数(秒)
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Val(Label1.Caption) - 1
If Label1.Caption = "0" Then
MsgBox "时间到"
Timer1.Enabled = False
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
添加一个Timer1、一个Label:
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
s = "2011-10-1"
s = CDate(s) - Now
If s < 0 Then Exit Sub
Label1 = Int(s) & "天" & Format(s, "hh时mm分ss秒")
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
s = "2011-10-1"
s = CDate(s) - Now
If s < 0 Then Exit Sub
Label1 = Int(s) & "天" & Format(s, "hh时mm分ss秒")
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询