3个回答
展开全部
可以用 Timer 控件来实现,设置它的 Interval 属性为1000,即1秒,然后在它的Timer事件里写代码。如:
Private mintNow as integer
Sub form_load()
mintnow = 100
Timer1.Enabled = true
end sub
Sub Timer1_Timer()
if mintnow > 0 then
Text1.Text = mintNow
mintNow = mintNow - 1
else
Timer1.Enabled = False
end if
End Sub
Private mintNow as integer
Sub form_load()
mintnow = 100
Timer1.Enabled = true
end sub
Sub Timer1_Timer()
if mintnow > 0 then
Text1.Text = mintNow
mintNow = mintNow - 1
else
Timer1.Enabled = False
end if
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Text1.Text = 100
Timer1.Interval = 1000
Timer1.Enabled = true
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
if text1.text="0" then
Timer1.Enabled = False
msgbox "时间到"
end if
End Sub
Text1.Text = 100
Timer1.Interval = 1000
Timer1.Enabled = true
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
if text1.text="0" then
Timer1.Enabled = False
msgbox "时间到"
end if
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Text1.Text = 100
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
End Sub
Text1.Text = 100
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |