Application.DoEvents Method

JGaraas

New member
Joined
Dec 3, 2004
Messages
2
Programming Experience
Beginner
I'm fairly new to VB.NET and am trying to convert an application from VB6 and I'm having a problem with the:

Application.DoEvents Method

Everytime I call this Method it restarts the code from the beginning of the For or Do Until Loop. Is this normal? If not can someone please post a piece of sample code explaining the proper use. Below is an example of the problem I'm having:

Count = 2

Do until count < 0
txtCurrentFile Transfer = File
Application.DoEvents
Transferfile(File)
Loop

You see I want to update the GUI as close to realtime as possible, I want a textbox stating the file currently being transferred right before the transfer begins and then do the actual transferring.

My problem is that when I get to Application.DoEvents it restarts back at Do Until.

Any Ideas or workarounds?

Thanks,
 
Top Bottom