Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

BackgroundWorker.ProgressChanged Event

Definition

Namespace:
System.ComponentModel
Assemblies:
System.dll, System.ComponentModel.EventBasedAsync.dll
Assemblies:
netstandard.dll, System.ComponentModel.EventBasedAsync.dll
Assembly:
System.ComponentModel.EventBasedAsync.dll
Assembly:
System.dll
Assembly:
netstandard.dll
Source:
BackgroundWorker.cs
Source:
BackgroundWorker.cs
Source:
BackgroundWorker.cs
Source:
BackgroundWorker.cs
Source:
BackgroundWorker.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Occurs when ReportProgress(Int32) is called.

public:
 event System::ComponentModel::ProgressChangedEventHandler ^ ProgressChanged;
public event System.ComponentModel.ProgressChangedEventHandler ProgressChanged;
public event System.ComponentModel.ProgressChangedEventHandler? ProgressChanged;
member this.ProgressChanged : System.ComponentModel.ProgressChangedEventHandler 
Public Custom Event ProgressChanged As ProgressChangedEventHandler 

Event Type

Examples

The following code example demonstrates the use of the ProgressChanged event to report the progress of an asynchronous operation to the user. This code example is part of a larger example provided for the BackgroundWorker class.

// This event handler updates the progress bar.
void backgroundWorker1_ProgressChanged( Object^ /*sender*/, ProgressChangedEventArgs^ e )
{
 this->progressBar1->Value = e->ProgressPercentage;
}
// This event handler updates the progress bar.
void backgroundWorker1_ProgressChanged(object sender,
 ProgressChangedEventArgs e) => progressBar1.Value = e.ProgressPercentage;
' This event handler updates the progress bar.
Private Sub backgroundWorker1_ProgressChanged(
ByVal sender As Object, ByVal e As ProgressChangedEventArgs) _
Handles backgroundWorker1.ProgressChanged

 progressBar1.Value = e.ProgressPercentage

End Sub

Remarks

This event is raised when you call the ReportProgress method.

For more information about how to handle events, see Handling and Raising Events.

Applies to

See also


Feedback

Was this page helpful?