Backgroundworker won't report progress

前端 未结 6 1005
情书的邮戳
情书的邮戳 2020-12-01 09:21

I have a background worker running a long database task. i want to show the progress bar while the task is running. Somehow the background worker won\'t report the progres

6条回答
  •  误落风尘
    2020-12-01 10:11

    Progress must be sent from within the DoWork event by calling the ReportProgress method on the BackgroundWorker. In your case, you can't report any progress because all of the work is being done outside of the DoWork function. You can only report progress before and after the call to getdate(), but not during the call since the BackgroundWorker thread is busy.

提交回复
热议问题