As you could probably guess from the parameter name, the first argument to the
ReportProgress
method is the percentage returned from the
ProgressPercentage
property of the
ProgressChangedEventArgs
class.
You are only passing in values between 1 and 20, which is why the progress bar never gets above 20%.
Convert the values to a percentage before passing them to the
ReportProgress
method:
backgroundWorker1.ReportProgress(i * 5);