Easy Multithreaded Programming Using BackgroundWorker
- Posted: Jan 24, 2006 at 2:54 PM
- 33,593 Views
- 6 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Here's a quote from
Chapter 6: Using Multiple Threads of the
Smart Client Architecture and Design Guide:
"To maximize the responsiveness of your smart client applications, you need to carefully consider how and when to use multiple threads. Threads can significantly improve the usability and performance of your application, but they require very careful consideration
when you determine how they will interact with the user interface."
.NET Framework 2.0 and the BackgroundWorker component to the rescue! Marc Schweigert, Federal Developer Evangelist, shows you how easy it is to build a responsive multithreaded Smart Client application with Windows Forms 2.0 & the BackgroundWorker component.
Resources:
Federal Developer Blog:
http://blogs.msdn.com/federaldev/
BackgroundWorker Component Overview:
http://msdn2.microsoft.com/en-us/library/8xs8549b.aspx
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Some may say that Channel 9 for them is all about "getting to know personalities at Microsoft". Well, I'll trade all of that for training.
This content is what Channel 9 offers me, and I thank you for it.
[6][A]
Although I know it would be easy to do, it would have been nice had the progress bar been used to show database load progress as well.
-Marc
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
for (int i = 1; i <= 10; i++)
{
if (backgroundWorker1.CancellationPending)
{
e.Cancel = true;
}
else
{
backgroundWorker1.ReportProgress(i * 10);
Thread.Sleep(1000);
}
}
}
I noticed that this video is no longer working on this site. Is there anyway you can get this video to be functional again?
thanks
Remove this comment
Remove this thread
close