Craig Johnston Craig Johnston - 6 months ago 51
C# Question

Use of Application.DoEvents()


be used in C#?

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


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.

The bottom line is: if you are going to use DoEvents, then you need to test it thoroughly before deploying your application.