DoEvents

First, let me just get this out of the way…

If you find yourself relying on DoEvents to make a process work in a way that seems more responsive than without it, you should probably be using asynchronous delegates, threading, Control.Invoke, etc. Yeah, yeah, yeah… I get it.

But sometimes yield on the UI thread and DoEvents is a simple way to do that. You’ll still got whatever performance issue was going on, of course, but using DoEvents can allow it to seem like the UI loads faster or that the application is under less strain, even though it isn’t. It’s a cheap and hacky solution, but sometimes ‘cheap and hacky’ are the right tools for the job…

Share Your Thought