Hi,
i have vb.net windows forms applciation.
i make a loop in order to do some work that consumes time, and i want the
user to be able to press the stop button in the middle, problem is that no
events are received while in the loop.
in VB6 we had the DoEvents command that did the job.
what is the vb.net replacement for DoEvents?
TIA, z.
Tim Wilson - 15 Jan 2005 19:25 GMT
Application.DoEvents()
Alternatively, you might consider using threads instead of calling
DoEvents...

Signature
Tim Wilson
.Net Compact Framework MVP
> Hi,
>
[quoted text clipped - 6 lines]
>
> TIA, z.
Jon Skeet [C# MVP] - 18 Jan 2005 07:20 GMT
> i have vb.net windows forms applciation.
> i make a loop in order to do some work that consumes time, and i want the
> user to be able to press the stop button in the middle, problem is that no
> events are received while in the loop.
> in VB6 we had the DoEvents command that did the job.
> what is the vb.net replacement for DoEvents?
DoEvents was basically a hack to simulate multithreading. In .NET
threading is there in all its glory - you should do anything time-
consuming on a non-UI thread.
See http://www.pobox.com/~skeet/csharp/threads for an introduction to
threads.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too