Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More VFP nostalgia : wait nowait
Message
From
10/10/2011 09:25:17
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01525944
Message ID:
01525962
Views:
65
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/ )
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform