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)

member RunWorkerAsync : 
        argument:Object -> unit

Parameters

argument
Type: System.Object

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

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

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:
© 2016 Microsoft