Alternative to Application.DoEvents()

放肆的年华 提交于 2019-11-30 10:23:32
Jalal Said

I recommend you to stop using Application.DoEvents(), it is generate problems more than it solves. check this.

A better way is either use an AutoResetEvent to notify whenever loading completed, or by raising an event whenever the loading is done. also you can run your waiting on another thread so don't have to use Application.DoEvents()...

You can use System.Threading.Thread.Join() as an alternative to DoEvents(), since this method halts your current thread execution until the preceding call thread completes execution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!