VB实现定时中断问题!!!!!
VB中如何实现定时器中断 就是程序当前在执行一段循环语句时,每过一秒就进行中断,跳出循环执行其它语句!执行完了在返回循环语句执行
Option Explicit Dim finish As Boolean Private Sub Form_Load() Dim i As Integer Form1.Show For i = 1 To 10 While (finish = False) DoEvents Wend Form1.Caption = i'循环体内要执行的代码 finish = False Timer1.Enabled = True Next End Sub Private Sub Timer1_Timer() Timer1.Enabled = False '添加定时到需完成的代码 finish = True End Sub