Thread: Delegates help
View Single Post
Old 07-25-2008   #5 (permalink)
breitak67


Vista Business x64
 
 

Re: Delegates help

The part about executing on another thread is probably an incomplete reference to the fact that when an event is raised from a thread other than the main GUI thread the event handler executes in the context of that thread. If the event handler has to update controls owned by the GUI thread you need to use a delegate and Invoke method to punt the execution of the handler code that updates the controls to the GUI thread (otherwise you will likely get a cross-threading exception). Summary: delegates can, in combination with the Invoke method, pass execution of the delegate method's code to the main GUI thread from another thread.
My System SpecsSystem Spec