
用VB 怎么让text1.text=按时间的秒数
怎么让text1.text=按时间的秒数,倒数30-0,并显示在text1.text该怎么写代码呢?不是每一次倒数都显示在TEXT1.TEXE里,只显示一个数,如--30...
怎么让text1.text=按时间的秒数,倒数30-0,并显示在text1.text 该怎么写代码呢? 不是每一次倒数都显示在TEXT1.TEXE里,只显示一个数,如--30,下次30不显示,直接显示29,就是由30变到0,要 倒数好像时间的秒一样
展开
6个回答
展开全部
插入一个timer控件
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
text1.text=30
End Sub
Private Sub Timer1_Timer()
Text1.Text = format(CLng(Text1.Text) - 1,"hhmmss")
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
绝对时间格式,呵呵
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
text1.text=30
End Sub
Private Sub Timer1_Timer()
Text1.Text = format(CLng(Text1.Text) - 1,"hhmmss")
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
绝对时间格式,呵呵
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim ot as double
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
text1.text=30
ot=timer
End Sub
Private Sub Timer1_Timer()
Text1.Text = fix(ot - timer + 30)
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
注意与ls几位的不同之处 这是很重要的 不要信任Timer控件的计时
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
text1.text=30
ot=timer
End Sub
Private Sub Timer1_Timer()
Text1.Text = fix(ot - timer + 30)
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
注意与ls几位的不同之处 这是很重要的 不要信任Timer控件的计时
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
插入一个timer控件
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
text1.text=30
End Sub
Private Sub Timer1_Timer()
Text1.Text = CLng(Text1.Text) - 1
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
text1.text=30
End Sub
Private Sub Timer1_Timer()
Text1.Text = CLng(Text1.Text) - 1
If Text1.Text = 0 Then Timer1.Enabled = False
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
插入一个timer控件
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
Text1.Text=30
Text1.FontSize=16
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
If Val(Text1.Text) = 0 Then Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
Text1.Text=30
Text1.FontSize=16
End Sub
Private Sub Timer1_Timer()
Text1.Text = Val(Text1.Text) - 1
If Val(Text1.Text) = 0 Then Timer1.Enabled = False
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Text1.Text = 30
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If Val(Text1.Text) <> 0 Then Text1.Text = Val(Text1.Text) - 1
End Sub
Text1.Text = 30
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If Val(Text1.Text) <> 0 Then Text1.Text = Val(Text1.Text) - 1
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询