Home All Groups Group Topic Archive Search About
Author
3 May 2007 6:01 PM
Andrew
Hi, guys,

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

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

Author
3 May 2007 6:14 PM
Henning Krause [MVP - Exchange]
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


Show quote
"Andrew" <And***@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.
Author
3 May 2007 6:17 PM
Jim Rand
Application.DoEvents();

Show quote
"Andrew" <And***@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.

AddThis Social Bookmark Button