I have code like below:
It starts thread, executes few statements of "ThreadStart" and then come back to btnConnect_Click and ends it then again move to thread "ThreadStart" , execute few statement and terminate without any prompt/error.
Can anyone help me.
Thanks.
When I click Button, as thread starts by th1.start, it starts thread without ending btnConnect_Click.Private Sub btnConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnect.Click
Try
DO something
Dim th1 As New Thread(AddressOf ThreadStart)
th1.IsBackground = True
'End If
th1.Start()
Catch ex As Exception
DO something
End Try
End Sub
It starts thread, executes few statements of "ThreadStart" and then come back to btnConnect_Click and ends it then again move to thread "ThreadStart" , execute few statement and terminate without any prompt/error.
Can anyone help me.
Thanks.