G
Guest
Hi,
I'm building an app that performs a long running operation when the user
clicks a button. I'm not sure how long the operation will take up front and
its not an interative task. I have 2 problems at the moment, one is
cancelling the operation and the other is displaying 'progress'. I've decided
to use the BackgroundWorker component in .Net 2.0 but I guess this is still a
relevent 1.1 question.
My first problem is when clicking the run button I change the text of the
button to cancel so when the user clicks it a second time I call the
backgroundWorker CancelAsync. This changes the text and allows the user to
run the process again. The problem is it doesn't seem to cancel the work
being done...instead the work continues and eventually it calls the work
completed method with e.cancelled being true etc but the main problem is not
time is saved....
The second problem is updating progress to the user. Since I have no idea
how long it will take and can't break the task up into steps I thought of
using the progress bar and moving progress up and down just to show something
is happening. Any suggestions for how to do this or a better way to do it?
Thanks
N
I'm building an app that performs a long running operation when the user
clicks a button. I'm not sure how long the operation will take up front and
its not an interative task. I have 2 problems at the moment, one is
cancelling the operation and the other is displaying 'progress'. I've decided
to use the BackgroundWorker component in .Net 2.0 but I guess this is still a
relevent 1.1 question.
My first problem is when clicking the run button I change the text of the
button to cancel so when the user clicks it a second time I call the
backgroundWorker CancelAsync. This changes the text and allows the user to
run the process again. The problem is it doesn't seem to cancel the work
being done...instead the work continues and eventually it calls the work
completed method with e.cancelled being true etc but the main problem is not
time is saved....
The second problem is updating progress to the user. Since I have no idea
how long it will take and can't break the task up into steps I thought of
using the progress bar and moving progress up and down just to show something
is happening. Any suggestions for how to do this or a better way to do it?
Thanks
N