Domanda

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
È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top