BackgroundWorker.ProgressChanged Event
.NET Framework 2.0
Occurs when ReportProgress is called.
Namespace: System.ComponentModel
Assembly: System (in system.dll)
Assembly: System (in system.dll)
'Declaration Public Event ProgressChanged As ProgressChangedEventHandler 'Usage Dim instance As BackgroundWorker Dim handler As ProgressChangedEventHandler AddHandler instance.ProgressChanged, handler
/** @event */ public void add_ProgressChanged (ProgressChangedEventHandler value) /** @event */ public void remove_ProgressChanged (ProgressChangedEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.
This event is raised when you call the ReportProgress method.
For more information about handling events, see Consuming Events.
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. Private Sub backgroundWorker1_ProgressChanged( _ ByVal sender As Object, ByVal e As ProgressChangedEventArgs) _ Handles backgroundWorker1.ProgressChanged Me.progressBar1.Value = e.ProgressPercentage End Sub
// This event handler updates the progress bar.
private void backgroundWorker1_ProgressChanged(Object sender,
ProgressChangedEventArgs e)
{
this.progressBar1.set_Value(e.get_ProgressPercentage());
} //backgroundWorker1_ProgressChanged
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 Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: