BackgroundWorker.ProgressChanged BackgroundWorker.ProgressChanged BackgroundWorker.ProgressChanged BackgroundWorker.ProgressChanged Event

定義

ReportProgress(Int32) が呼び出されたときに発生します。Occurs when ReportProgress(Int32) is called.

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

次のコード例は、の使用を示します、ProgressChangedをユーザーに非同期操作の進行状況を報告するイベントです。The following code example demonstrates the use of the ProgressChanged event to report the progress of an asynchronous operation to the user. このコード例が示されている例の一部、BackgroundWorkerクラス。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.
private void backgroundWorker1_ProgressChanged(object sender,
    ProgressChangedEventArgs e)
{
    this.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

    Me.progressBar1.Value = e.ProgressPercentage

End Sub

注釈

このイベントを呼び出すときに発生しますが、ReportProgressメソッド。This event is raised when you call the ReportProgress method.

イベントを処理する方法の詳細については、次を参照してください。処理とイベントの発生します。For more information about how to handle events, see Handling and Raising Events.

適用対象

こちらもご覧ください