“此BackgroundWorker声明它不报告进度。” – 为什么?

我是这个背景工作者的新手
我读过一些关于如何创建一篇文章的文章
这就是它产生的

private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { Bitmap imgbox = new Bitmap(pictureBox.Image); int imgHeight = imgbox.Height; int imgWidth = imgbox.Width; int counter = 1; MinMaxWidth = imgWidth - 50; MaxWidth = imgWidth; try { Color c; //Color c2; for (int i = 0; i < imgbox.Width; i++) { for (int j = 0; j < imgbox.Height; j++) { c = imgbox.GetPixel(i, j); string cn = c.Name; counter++; backgroundWorker1.ReportProgress(counter); } } MessageBox.Show("SUCESSFULLY DONE"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { MyProgress.Value = e.ProgressPercentage; } 

但是当我开始DoWork活动时。 这个错误出现了

BackgroundWorker声明它不报告进度。
修改WorkerReportsProgess以声明它确实报告进度。

我应该遵循教程所说的内容
会有什么问题?,有什么我忘了吗?

如错误所示,将BackgroundWorker组件的WorkerReportsProgress属性设置为true