急求 vb定时执行的问题
比如,我有 "开始 "和 "结束 "两个按纽,我按了 "开始 "按纽后,运行5秒钟执行结束按纽,然后过一段时间,我再按 "开始 "按纽后,再运行5秒后执行 "结束 "按纽.( "结束 "按纽的程序当然可自己定,请求高手帮忙啊~~~~~~~~~~~
[解决办法]
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
MsgBox "结束啦 "
End Sub
Private Sub Form_Load()
Timer1.Interval = 5000 '5秒
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
Call Command2_Click
End Sub