开发者

Updating UI controls from a Background Thread

开发者 https://www.devze.com 2023-02-18 19:39 出处:网络
I have a GUI program that runs on a Windows CE 2.0 Device.At one point I need to do a remote request to a Web Server that I want to do in a background Thread, the problem is that I also need to update

I have a GUI program that runs on a Windows CE 2.0 Device. At one point I need to do a remote request to a Web Server that I want to do in a background Thread, the problem is that I also need to update a progress bar and a button's 'Enabled' property while 开发者_开发问答this process is going on.

BackgroundWorker() is not available for some reason (it is greyed out). How do I start a background thread and update UI controls from this Thread.


Use the Invoke method on the UI control to update it from a background thread.

See ThreadStart for the old way of doing things on background threads.

0

精彩评论

暂无评论...
验证码 换一张
取 消