Jeremy,
While there are some legitimate uses for calling DoEvents, more often
than not, it is used to pump messages in the UI thread when performing a
long-running task in the UI thread. Generally, this is a bad idea, as you
should process that task in another thread, and then marshal calls to
update the UI back to the UI thread through a call to the Invoke method.
To be honest, it is mainly for the VB crowd.
Is it ever required? No.
Is it a good idea? No.
Is it a bad idea? Almost always yes. For the reasons why, see a
previous post by me on this topic:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/bcb7064ad2629734
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Jeremy S. said:
Application.DoEvents();
Why would I ever want to do that? When is it (1) required, or (2) a "good
idea" or (3) a "bad idea"
Thanks.