Cross thread exception

前端 未结 4 1007
慢半拍i
慢半拍i 2021-01-26 05:19

I am having a problem for a while

this line:

txtPastes.Text = (string)e.UserState;

throws a cross thread exception and I didn\'t find a

4条回答
  •  被撕碎了的回忆
    2021-01-26 05:39

    Make sure you start the BackgroundWorker from the UI thread; if you do that, the ProgressChanged event will be raised on that thread, and the exception won't happen.

提交回复
热议问题