Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone:)

I have a thread question!

I use this code to start a thread:

       Dim Threads As New Thread(New ParameterizedThreadStart(AddressOf MyThread))
       Threads.Start()

And here is inside my thread:

   Private Sub MyThread(ByVal o As Object)
       ...
   End Sub

I want to know how can I CLOSE the form from inside thread?

Please help me as I am not very PRO in threads!

For example, I know to set the TEXT in a thread I should use this:

   Private Delegate Sub SetAccountsTextCallback(ByVal Message As String)
   Private Sub SetAccountsText(ByVal Message As String)
       On Error Resume Next
       If Me.AccountsProgressBarX.InvokeRequired Then
           Dim d As New SetAccountsTextCallback(AddressOf SetAccountsText)
           Me.Invoke(d, New Object() {Message})
       Else
           Me.AccountsProgressBarX.Text = Message
       End If
   End Sub

But cannot imagine how to close the form!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...