943,865 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 9301
  • C# RSS
Oct 4th, 2007
0

Window Timer in a new Thread

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saurabh singh is offline Offline
9 posts
since Feb 2005
Oct 4th, 2007
0

Re: Window Timer in a new Thread

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
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006
Oct 4th, 2007
0

Re: Window Timer in a new Thread

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.








Click to Expand / Collapse  Quote originally posted by Exelio ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
saurabh singh is offline Offline
9 posts
since Feb 2005
Jun 5th, 2008
0

Re: Window Timer in a new Thread

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vavatl is offline Offline
1 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Setting Environment Variable using C#
Next Thread in C# Forum Timeline: managing object in callback





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC