Hi, guys,

As you know, in VB6, we have have DoEvents.

How can we do the same job in c#.net? Thanks.

Re: DoEvents in c#.net by Henning

Henning
Thu May 03 13:14:36 CDT 2007

Hello,

short answer: Don't use it.

Long answer:
You can call Application.DoEvents() to get a similar functionality. But if
you perform long-running tasks, perform them on a background thread and just
use the UI thread to update the UI.

In .NET, you can utilize the BackgroundWorker for that. It nicely handles
all the cross-thread calls which are necessary to update the UI.

In .NET 1.1, use the ThreadPool or a dedicated new thread and update the UI
with calls through form.Invoke(), where form is the window you want to
update.

Best regards,
Henning Krause


"Andrew" <Andrew@discussions.microsoft.com> wrote in message
news:55C9C399-7886-44B1-B0E0-1272DC6D3614@microsoft.com...
> Hi, guys,
>
> As you know, in VB6, we have have DoEvents.
>
> How can we do the same job in c#.net? Thanks.


Re: DoEvents in c#.net by Jim

Jim
Thu May 03 13:17:27 CDT 2007

Application.DoEvents();

"Andrew" <Andrew@discussions.microsoft.com> wrote in message
news:55C9C399-7886-44B1-B0E0-1272DC6D3614@microsoft.com...
> Hi, guys,
>
> As you know, in VB6, we have have DoEvents.
>
> How can we do the same job in c#.net? Thanks.