BackgroundWorker still needs to call Invoke?

后端 未结 3 431
面向向阳花
面向向阳花 2021-01-15 08:00

In the last question Display progress bar while doing some work in C#?, people has recommend use of BackgroundWorker. I thought in BackgroundWorker

3条回答
  •  生来不讨喜
    2021-01-15 08:20

    The RunWorkerCompleted callback is marshalled onto the UI thread; DoWork is not.

    You should use the ReportProgress method to update the UI during DoWork processing.

    See: How to: Run an Operation in the Background

提交回复
热议问题