|
-
Apr 20th, 2009, 08:04 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Raise event after thread end
Hi, how can I raise an event after a thread has just ended?
Thanks
-
Apr 20th, 2009, 08:59 AM
#2
Re: Raise event after thread end
The BackGroundWorker will do this automatically, so I assume that you are talking about a plain thread. One option would be to switch to using the BackGroundWorker so that you get the event, and the other option is to raise the event as the final act of the thread.
For that second option, I save the SynchronizationContext of the UI thread, then Post a call to a sub in UI context that raises the event. By doing this, the event is raised in the UI thread, not in the background thread. If you want more information on that, search for my name and SynchronizationContext, as I have posted examples a couple of times. However, the BackGroundWorker object sounds like it may be more appropriate for you.
My usual boring signature: Nothing
 
-
Apr 20th, 2009, 09:02 AM
#3
Thread Starter
Addicted Member
Re: Raise event after thread end
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|