Export (0) Print
Expand All

BackgroundWorker.ReportProgress Method (Int32, Object)

Raises the ProgressChanged event.

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

public void ReportProgress(
	int percentProgress,
	Object userState
)

Parameters

percentProgress
Type: System.Int32
The percentage, from 0 to 100, of the background operation that is completed.
userState
Type: System.Object
The state object passed to RunWorkerAsync.

ExceptionCondition
InvalidOperationException

The WorkerReportsProgress property is set to false.

If you need the background operation to report on its progress, you can call the ReportProgress method to raise the ProgressChanged event. The WorkerReportsProgress property value must be true, or ReportProgress will throw an InvalidOperationException.

It is up to you to implement a meaningful way of measuring your background operation's progress as a percentage of the total task completed.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft