RunWorkerAsync Method (Object)
Collapse the table of content
Expand the table of content

BackgroundWorker.RunWorkerAsync Method (Object)


Starts execution of a background operation.

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

public void RunWorkerAsync(
	object argument


Type: System.Object

A parameter for use by the background operation to be executed in the DoWork event handler.

Exception Condition

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 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.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft