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

Definizione

Si verifica quando viene chiamato il metodo 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 

Esempi

Esempio di codice seguente viene illustrato l'utilizzo del ProgressChanged evento per segnalare lo stato di avanzamento di un'operazione asincrona all'utente.The following code example demonstrates the use of the ProgressChanged event to report the progress of an asynchronous operation to the user. Questo esempio di codice è parte di un esempio più esaustivo disponibile per il BackgroundWorker classe.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

Commenti

Questo evento viene generato quando si chiama il ReportProgress (metodo).This event is raised when you call the ReportProgress method.

Per altre informazioni su come gestire gli eventi, vedere la gestione e generazione di eventi.For more information about how to handle events, see Handling and Raising Events.

Si applica a

Vedi anche