问题描述
能否 Application.DoEvents()
在C#中使用?
这是功能的方式,让GUI赶上与应用程序的其余部分,在大致相同的方式,VB6的的DoEvents
呢?
Is this function a way to allow the GUI to catch up with the rest of the app, in much the same way that VB6's DoEvents
does?
推荐答案
从我的经验,我会在.NET中使用的DoEvents建议非常谨慎。我在含DataGridViews一个TabControl使用的DoEvents当经历过一些非常奇怪的结果。在另一方面,如果你正在处理的是一个小形式的进度条,那么它可能会确定。
From my experience I would advise great caution with using DoEvents in .NET. I experienced some very strange results when using DoEvents in a TabControl containing DataGridViews. On the other hand, if all you're dealing with is a small form with a progress bar then it might be OK.
底线是:如果你打算使用的DoEvents,那么你就需要部署应用程序之前,测试它彻底
The bottom line is: if you are going to use DoEvents, then you need to test it thoroughly before deploying your application.
这篇关于使用Application.DoEvents的()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!