Re: no response for cancel button click

Re: no response for cancel button click

am 07.01.2008 16:10:06 von Marc Gravell

I'm assuming that the download is happening on the UI thread; this
means that the UI cannot respond to any inputs. You should investigate
the BackgroundWorker component (lots of examples around), which will
push this work to a background thread, while still making it easy (via
the progress changed event) to update your progress-bar. Most
importantly, the UI thread will be able to service the cancel button,
and ask the BackgroundWorker to cancel (your code needs to check for
this cancellation request periodically).

Marc