vb倒计时运行某个窗体代码
2013-11-07
展开全部
timer1的属性为 enabled=FALSE interval=1000假设是按command1设置时间 text1为设置的时间 则代码如下:dim t as integerprivate sub form1_load() text1=""end subprivate sub command1_click() t=text1 timer1.enabled=tureend subprivate sub timer1_timer() t=t-1 if t=0 then load form2:form2.show:timer1.enabled=falseend sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-07
展开全部
Dim times As IntegerPrivate Sub Command1_Click()
If IsNumeric(Text1.Text) Then
Timer1.Enabled = True
Else
MsgBox "请输入正确的数字(秒)"
Exit Sub
End If
End SubPrivate Sub Form_Load()
Text1.Text = ""
Timer1.Enabled = False
End SubPrivate Sub Timer1_Timer()
Text1.Text = Text1.Text - 1
If Text1.Text = 0 Then
Load Form2
Form2.Show
Timer1.Enabled = False
End If
End Sub
If IsNumeric(Text1.Text) Then
Timer1.Enabled = True
Else
MsgBox "请输入正确的数字(秒)"
Exit Sub
End If
End SubPrivate Sub Form_Load()
Text1.Text = ""
Timer1.Enabled = False
End SubPrivate Sub Timer1_Timer()
Text1.Text = Text1.Text - 1
If Text1.Text = 0 Then
Load Form2
Form2.Show
Timer1.Enabled = False
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-07
展开全部
Private Sub Command1_Click()
Timer1 = True
End SubPrivate Sub Form_Load()
Timer1 = False
Timer1.Interval = 1000
Text1 = 5
End SubPrivate Sub Timer1_Timer()
Text1 = Text1 - 1
If Text1 = 0 Then
Form2.Show
End If
End Sub
Timer1 = True
End SubPrivate Sub Form_Load()
Timer1 = False
Timer1.Interval = 1000
Text1 = 5
End SubPrivate Sub Timer1_Timer()
Text1 = Text1 - 1
If Text1 = 0 Then
Form2.Show
End If
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询