BackgroundWorker::RunWorkerAsync Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Starts execution of a background operation.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public:
void RunWorkerAsync()

Exception Condition
InvalidOperationException

IsBusy is true.

The RunWorkerAsync method submits a request to start the operation running asynchronously. When the request is serviced, the DoWork event is raised, which in turn starts execution of your background operation.

If the background operation is already running, calling RunWorkerAsync again will raise an InvalidOperationException.

The following code example demonstrates the use of the RunWorkerAsync method to start an asynchronous operation. It is part of a larger example described in How to: Download a File in the Background.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: