DoWork of BackgroundWorker is called twice when RunWorkerAsync is called once?

前端 未结 7 1273
情深已故
情深已故 2020-12-06 01:51

I have create a backgroundworker in an class it works, but if i call and wait until the end run, call it for the second time it will do the same process twice

i thin

相关标签:
7条回答
  • 2020-12-06 02:17

    In my case, BackgroundWorker was running twice because in the constructor class of my form I declared the DoWork, ProgressChanged and RunWorkerCompleted event handlers, but it was already declared by Visual Studio 2013 in Designer part of this form class.

    So, I just deleted my declarations and it worked fine.

    0 讨论(0)
提交回复
热议问题