Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

thread? help?

 

Ok, i have some code that wait for a connection,

But i'd like to do other stuff, at the same time,

So i thing thread will help me there, tell me if i'm wrong.

And thread would also make it posible to pause the funtion? and restart later?

 

and if it is the bets way, how do i creat, stop and start a thread?

 

Thanx in advance

Edited by jorge
  • *Experts*
Posted
Look in the MSDN for System.Threading namespace. Here's a short example:
Private Sub SecondarySub()
 'do the stuff you want to do while waiting
End Sub

Private Sub Form_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
 Dim t As New Threading.Thread(AddressOf SecondarySub)
 t.Start()

 'wait for connection here...
End Sub

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...