The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
BackgroundWorker.IsBusy Property
.NET Framework 2.0
Gets a value indicating whether the BackgroundWorker is running an asynchronous operation.
Namespace: System.ComponentModel
Assembly: System (in system.dll)
Assembly: System (in system.dll)
The BackgroundWorker starts an asynchronous operation when you call RunWorkerAsync.
The following code example demonstrates how to use the IsBusy property to wait for completion of a BackgroundWorker operation. This code example is part of a larger example described in How to: Download a File in the Background.
private void dowloadButton_Click(object sender, EventArgs e) { // Start the download operation in the background. this.backgroundWorker1.RunWorkerAsync(); // Disable the button for the duration of the download. this.dowloadButton.Enabled = false; // Wait for the BackgroundWorker to finish the download. while (this.backgroundWorker1.IsBusy) { // Keep UI messages moving, so the form remains // responsive during the asynchronous operation. Application.DoEvents(); } // The download is done, so enable the button. this.dowloadButton.Enabled = true; }
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.