Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim firstThread As New Thread(AddressOf Fu1) firstThread.Start() 'I want to determine the job of sub (Fun) is finished and then run other code. Normally if i add other code after firstThread.Start() code is running before completed job of Fun (Codes after firstThread.Start() is depended on finished Fun) End Sub Sub Fun() 'Something code is here End Sub
Dim firstThread As New Thread(AddressOf Job1) Dim SecondThread As New Thread(AddressOf Job2) Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click firstThread.Start() SecondThread.Start() End Sub Sub Job1() 'Something code is here End Sub Sub Job2() While (Job1.IsAlive) End While 'Job 2 End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim firstThread As New Thread(AddressOf Fu1) firstThread.Start() firstThread.Join() 'I want to determine the job of sub (Fun) is finished and then run other code. Normally if i add other code after firstThread.Start() code is running before ompleted job of Fun (Codes after firstThread.Start() is depended on finished Fun) End Sub Sub Fun() 'Something code is here End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)