The BackgroundWorker class
] offers a method ReportProgress
] that causes the ProgressChanged
] event to be risen not in the working thread but in the thread that created the BackgroundWorker. Usually that is the GUI thread. You can therefore call the method in the worker thread and handle the event in the GUI thread, which can change a label without hassle.
Now you have to rename
so the method name doesn't interfere with the "other"
public void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
DownloadProgressBar.Value = e.ProgressPercentage;