SIMIN Posted June 10, 2008 Posted June 10, 2008 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. Quote
Nate Bross Posted June 10, 2008 Posted June 10, 2008 What does the ConnectThread method look like? Where is the timer object defined? Is it possible that it is a simple matter of scope? Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
SIMIN Posted June 10, 2008 Author Posted June 10, 2008 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 Quote
Administrators PlausiblyDamp Posted June 10, 2008 Administrators Posted June 10, 2008 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). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.