Instead of using sync apis, use the asynchronous versions of
Httpwebrequest/response. Then, in the callback handler, make sure that you
post messages to the main window.
--
feroze
-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.
See
http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------
"Scott Emick" <se****@ham.fox-international.com> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
Maybe you could launch a seprate process to do the sending and receiving
of the data which would periodically update the ui?
Because your are doing the data retrieval synchronously and therefore
cannot put doevents anywhere to allow the ui to update/check for events.
Scott Emick
"Ben Solomon" <bs****************@yahoo.com> wrote in message
news:A6**********************************@microsof t.com... Seems like the app crashes when focus is changed.
The focus could remain on the progressbar as I get the impression
there's really nothing the user is supposed to to until the download
is done anyway.
I'd also set a breakpoint on the Cancel button click handler.
There's housekeeping to be done there for sure.
"Charles A. Lackman" wrote:
Hello,
I have an app that has a process bar on it and it sends and retrieves
data
back and forth to a web page using WebRequest and WebResponse. The
stream
is received from the web page and written into a memorystream then
written
to a file on the hard drive. When the app's start button is clicked
the first thing that happens is that the size of the file is displayed
(i.e. 51
of 562 Downloaded) untile the download is complete. The problem is
that when you click on the cancel button (to stop the download) or if you
click
around the form or outside of the form, the application stops
responding, the cancel buttons event does not fire when the steaming is happening.
Any suggestions will be greatly appreciated.
Chuck