Home Code Downloads Delegate Example Code
mouse150x600b.jpg
Delegate Example Code Print E-mail

This program was made to demonstrate how to use delegates for cross thread operations.  For example you want to run a process in another thread that does some time/process intensive task.  You want it in it's own thread so it doesn't lockup your user interface but you want to get status information back to your main form so you know where in the process it is.  Normally if you tried to update a status bar or text box from another thread you would get a "Cross-thread operation not valid: Control 'yourcontrolname' accessed from a thread other than the thread it was created on." error.  Using the code in this example you will see how to get around this.

 

Download the VB.Net 2008 SP1 source code: code-delegateapp.zip

 

Screen shot:

Delegate App Screenshot

 

This source is released under the GPL