WinForm的多线程。使用BackgroundWorker的或没有? [英] WinForm Multithreading. Use backgroundWorker or not?
本文介绍了WinForm的多线程。使用BackgroundWorker的或没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的应用程序,它的一系列数据密集型任务的火灾。我不是很有经验的WinForms和我想知道这样做没有锁定界面的最佳方式。可以BackgroundWorker的重新使用,或有另一种方式来做到这一点?
I have a simple app which fires of a series of data intensive tasks. I'm not very experienced with WinForms and I was wondering the best way to do this without locking the interface. Can backgroundWorker be re-used, or is there another way to do this?
感谢
推荐答案
的BackgroundWorker
的可以的使用
它的好处 - 它可以让你更新进度条,并与UI控件进行交互。 ( WorkerReportsProgress
)
its benefit - it allows you to update a progress bar and interact with UI controls. (WorkerReportsProgress
)
此外,它有一个取消机制。 ( WorkerSupportsCancellation
)
Also it has a cancellation mechanism. (WorkerSupportsCancellation
)
这篇关于WinForm的多线程。使用BackgroundWorker的或没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文