Results 1 to 6 of 6

Thread: Thread problem!!Help me

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2008
    Posts
    3

    Unhappy Thread problem!!Help me

    I have code like below:

    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
    When I click Button, as thread starts by th1.start, it starts thread without ending btnConnect_Click.
    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.
    Last edited by memo421; Jan 3rd, 2009 at 12:09 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width