How to pause loop after form loses focus vb.net

Hi
I have a program written in vb.net it uses a loop to upload files to an ftp site. My problem is if the form loses focus although the upload is going on the user loses control of the form until the upload is finished. How can I make it so that this does not happen.

Thanks

Nick Steele
nsteele84Asked:
Who is Participating?
 
ToddBeaulieuConnect With a Mentor Commented:
Hello,

You're most likely doing this upload on the main thread, in response to a UI control.

You need to use a worker thread to perform the upload in the background. That thread would have to monitor for requests from the user to cancel. You'd also have to control program exit if it's in progress.

There's quite a bit involved in threading, but there are tons of references online with basic examples.
0
 
nsteele84Author Commented:
Hi I had an idea it was to do with threads. I have never used them but no it is time. Thanks
0
 
jesusafloresCommented:

What control used for upload the files??, if use the standar control, so the ejecution have run in other thread the process to  upload, but if use AJAX is not necessary because the processes are asynchronous
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.