使用带有dowork事件的backgroundworker将文本更新到文本框中? [英] update text into textbox using backgroundworker with dowork event ?

查看:75
本文介绍了使用带有dowork事件的backgroundworker将文本更新到文本框中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的问题是如何使用带有dowork事件的backgroundworker将文本更新到文本框中?



使用runworkercompleted它会挂起形式,但与dowork它不会...



需要帮助

thnxxs


my question is how to update text into textbox using backgroundworker with dowork event ?

while using runworkercompleted it goes hang the form but with dowork it wont ...

need help
thnxxs

推荐答案

好吧,您可以在worker DoWork方法中使用Invoke,但更好的办法是使用 ProgressChanged事件 [ ^ ]并通过ProgressChangedEventArgs参数的 UserState属性 [ ^ ]
Well, you could use Invoke within the worker DoWork method, but a better idea is to use the ProgressChanged event[^] and pass the string to update with via the ProgressChangedEventArgs parameter's UserState property[^]


这篇关于使用带有dowork事件的backgroundworker将文本更新到文本框中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆