Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More VFP nostalgia : wait nowait
Message
De
10/10/2011 09:25:17
 
 
À
10/10/2011 09:05:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01525944
Message ID:
01525962
Vues:
64
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform