Window Timer in a new Thread

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2005
Posts: 9
Reputation: saurabh singh is an unknown quantity at this point 
Solved Threads: 0
saurabh singh saurabh singh is offline Offline
Newbie Poster

Window Timer in a new Thread

 
0
  #1
Oct 4th, 2007
Hi ,
I want to create a System.Windows.Forms.Timer in a new Thread.
When I do this everything remains OK but the timer never goes inside
its tick event.I'm in deadlock condition. If anyone can give me some hint,
I shall be very thankful to him/her.

Regards-
Saurabh
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: Window Timer in a new Thread

 
0
  #2
Oct 4th, 2007
hi,

I am not sure whether i understood you fully. but a timer runs in a thread.
Why do you want to have a timer in a new thread?

could you please elaborate your requirement so that we can help you?

Regards


Exelio
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 9
Reputation: saurabh singh is an unknown quantity at this point 
Solved Threads: 0
saurabh singh saurabh singh is offline Offline
Newbie Poster

Re: Window Timer in a new Thread

 
0
  #3
Oct 4th, 2007
Thanks for reply,

[there is a form that has to be moved on the screen]-->[it is complete,with timer]
-->[timer moves it on the screen]-->[now its instance is to be created in some another form application, in a new thread (due to some reason)]-->[Now when this instance is called in the new form then it's timer's tick event doesn't work]

this is the scenario.








Originally Posted by Exelio View Post
hi,

I am not sure whether i understood you fully. but a timer runs in a thread.
Why do you want to have a timer in a new thread?

could you please elaborate your requirement so that we can help you?

Regards


Exelio
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 1
Reputation: vavatl is an unknown quantity at this point 
Solved Threads: 0
vavatl vavatl is offline Offline
Newbie Poster

Re: Window Timer in a new Thread

 
0
  #4
Jun 5th, 2008
Originally Posted by saurabh singh View Post
Hi ,
I want to create a System.Windows.Forms.Timer in a new Thread.
When I do this everything remains OK but the timer never goes inside
its tick event.I'm in deadlock condition. If anyone can give me some hint,
I shall be very thankful to him/her.

Regards-
Saurabh
It's probably too late but just for the sake of others who will come here from Google. It doesn't work because it adds events to a different queue than main application one and so events doesn't get dispatched. I guess (but never tried this myself) calling Application.DoEvents() in the thread where timer was started should cure the situation. Of course you would have to call it all the time, just one time wouldn't do it.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC