How to stop a procedure?

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I've got my app doing what I want it to do, crawling a web site for data.
However, while it's in the "WebRequest/WebResponse" procedure, the app
doesn't respond. So it's like the app is locked up for approx 3 minutes
while it's doing its thing. Is there any way to make it responsive during
this time so that I can put a "Stop" button on the form and make it work?
 
Use a separate thread for your WebRequest/WebResponse procedure. Then if you
want to end this process... just kill the thread.

Cheers,
Lubos
 
you can try to periodically run this line
Application.DoEvents()

but you should be aware of the possibility to restart the same code ...
 
Back
Top