Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I start a new thread this way:

 

Dim Threads As New Thread(New ParameterizedThreadStart(AddressOf ConnectThread))

Threads.Start()

 

However, from within this thread, I enable a timer, but the problem is that when this thread finish, timer is disposed as well.

How can I enable a timer from a thread, is it impossible?

Please help me.

Thanks.

Posted

What does the ConnectThread method look like? Where is the timer object defined?

 

Is it possible that it is a simple matter of scope?

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Posted

No, it's a thread problem, I simply put a timer from Toolbox / Components.

I think you didn't work with threads so much! :D

  • Administrators
Posted

You could have been clearer about which Kinf of Timer you were using...

 

If you are using the timer component from the toolbox then there is a strong probability that you are suffering from a cross thread / UI issue. You might want to .Invoke a method from the form itself to start the timer or investigate using one of the other timer objects (e.g. System.Threading.Timer).

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

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