Updating a Progress Bar from Another Thread

后端 未结 3 1553
故里飘歌
故里飘歌 2020-12-18 12:50

I have a windows form on the main thread and another thread that does some calculations. I\'d like to update the status bar on my form from the work being done in the other

3条回答
  •  执念已碎
    2020-12-18 13:11

    Make sure that you only update the user interface from the main thread or else you will have problems. You can switch your thread context by calling Invoke. There's a good post here on that.

提交回复
热议问题