Link to home
Start Free TrialLog in
Avatar of Richard Payne
Richard PayneFlag for Bulgaria

asked on

C#, VS2008, Thread, Progress-Bar within form.

(a) I have ordinary window form called AccessForm with button and a ProgressBar
(b) When the button is clicked, it will performs an operation involving internet and files, which is slow process,
(c) I found that while the an operation is ongoing, the AccessForm is hanged waiting for completion of the operation.
(d) This affects the ProgressBar because it does not show progress even when I made a value change.
(c) Thus I'm using WorkerThread that encapsulate the slow operation in order to keep AccessForm active and available for user,  so user can stop the operation when needed.

Question
(a) What the best way to update the ProgressBar within the AccessForm when  threaded routine can completed one stage of several tasks.
(b) I prefer not to send code, however is there similar example?

Thanks.

Avatar of namazikhah
namazikhah
Flag of Iran, Islamic Republic of image

hi,
the best practice is using BackgroundWorker on your form. You can find the example in this page:

hope it works ;)
ASKER CERTIFIED SOLUTION
Avatar of roeib
roeib

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial