How I use background worker with progress bar?
If my work is completed then progress bar will complete it's maximum length.
If not then it can't touch the maximum length.
I can't use them to make perfect look as i wish.
plz help me.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tanmay SarkarPosted Jul 6, 2010, 12:19 AM
I get your point. Actually there is varies type of connection so i can't limited it in a certain time period. So I think it's better to avoid progress bar because i build it for my those friends, who use slow connection, and waste lot of time to opening their mail ID to send mail. :-)
Thank you sir.
Sam HobbsPosted Jul 5, 2010, 11:55 PM
If so, then perhaps you can show a marquee style progress bar.
I assume you have a timeout value and your program will stop trying after the timeout period, so perhaps the progress bar could show the amount of time remaining before the timeout.
If you are unable to do the reading synchronously with a timeout that you can use to stop trying and then report progress then start trying again, then you must use asynchronous reads, and that will be a lot more work. It is something I have tried to do and I have not got it working entirely; I don't know what the problem is.
Tanmay SarkarPosted Jul 5, 2010, 10:40 PM
That's why I want to use progress bar.
I can use background worker & progress bar with "for" condition,
like for(int i=0;i<1000;i++).
But how i implement it, while it sending a mail?
help me plz!
Thank you Sir
Sam HobbsPosted Jul 5, 2010, 5:42 PM
Do the work in the DoWork event. During the work, call ReportProgress and in the prgresschanged (whatever it is called) event update the progress bar.