문제

i need help here.

how to make a vb.net timer to wait until all jobs finished and restart again?

am i do it correctly?

*a button will start Timer3 with interval=1

Private Sub Timer3_Tick(sender As System.Object, e As System.EventArgs) Handles Timer3.Tick
Timer3.stop() 'timer stops
     For i As Integer = 0 To ListBox1.Items.Count - 1   'Listbox contains 50 items
        If x > 0 then
           For j As Integer = wB + 1 To currentrecord Step 1
               'some if statements
               'end if statements
           Next
        End if
     Next
Timer3.Start()  'timer start again
End Sub
도움이 되었습니까?

해결책

That will do it (although you will need Timer3.Enabled = False and Timer3.Enabled = True to stop and start it.

Note though that if this is a Windows Forms timer it is not multi threaded. There is a comparison of timers here: http://msdn.microsoft.com/en-us/magazine/cc164015.aspx

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top