::RunWorkerAsync Method (Object^)
.NET Framework (current version)
Starts execution of a background operation.
System (in System.dll)
A parameter for use by the background operation to be executed in the
DoWork event handler.
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 your operation requires a parameter, you can provide it as the
argument parameter to RunWorkerAsync.
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. This code example is part of a larger example provided for the BackgroundWorker class.
// Start the asynchronous operation.
backgroundWorker1->RunWorkerAsync( numberToCompute );
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