Hello again everyone!
I have an issue that I can't seem to find a straight answer for anywhere... I have a For loop that sends a file name to a background worker that contains some long running code and I can't find a way for the parent thread to wait for the background worker to finish... Here is the example code:
What exactly is the correct coding that would make the For loop "wait" until the background worker has completed it's task? Any help would be great! Thank you all!
I have an issue that I can't seem to find a straight answer for anywhere... I have a For loop that sends a file name to a background worker that contains some long running code and I can't find a way for the parent thread to wait for the background worker to finish... Here is the example code:
Code:
For i = 0 to 4
BacgroundWorker1.RunWorkerAsync(fileName(i))
Next
Private Sub BackgroundWorker1(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
' Long running code...
End Sub
Comment