BackgroundWorker.RunWorkerAsync Method (Object)
Assembly: System (in system.dll)
A parameter for use by the background operation to be executed in the DoWork event handler.
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. backgroundWorker1.RunWorkerAsync(numberToCompute);
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 EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.