I've got the CTP but I'm not sure that it is (or would be) the best approach in this situation since, unless I've missed something, there's no way to communicate progress. Also the async method doesn't actually run in another thread so in some ways would be less efficient.....
>This is exactly what the new Asynch stuff is designed for and makes it lots easier. In C# it's implemented with the Asynch/Await commands. But the version of .Net that supports that is not in production yet.
>
>>It's pretty straightforward.
>>(a) Create a BackgroundWorker Instance.
>>(b) Wire it up so that when RunWorkerAsync is called it runs whatever code should be executed in the backgound in bgw_DoWork.
>>(c) Set the WorkerReportsProgress true
>>(d) Wire up the bgw_ProgressChanged method so that it is called when .ReportProgress is raised in the bgw_DoWork.
>>(e) Update the progress bar (or do something else) in the bgw_ProgressChanged callback.
>>
>>If you want to perform some other action when the worker completes then wire up the RunWorkerCompleted event as well.
>>
>>The example below is self-contained and debugging that with breakpoints should make it easy to understand what's going on.
>>(Don't forget there's a pretty good C# => VB.NET converter at
http://www.developerfusion.com/tools/convert/csharp-to-vb/ )