jtran007
asked on
Create dialog box with progress bar and button
Hi Expert,
I have a lenghtly process ( retrieve data from MySql and do some calculations) I'd like
while I am processing data, I can use a pop up dialog box where there is progress bar
to monitor the ongoing proces, and a CAncel button that uer can abort the process if it
takes too long.
Could you how to implement this task?
Thanks,
JT
I have a lenghtly process ( retrieve data from MySql and do some calculations) I'd like
while I am processing data, I can use a pop up dialog box where there is progress bar
to monitor the ongoing proces, and a CAncel button that uer can abort the process if it
takes too long.
Could you how to implement this task?
Thanks,
JT
ASKER
Hi Expert,
Thanks How do I use progessba to report the status of background task, and use cancel button to
cancel background task
Since I am new to c#, please help
JT
Thanks How do I use progessba to report the status of background task, and use cancel button to
cancel background task
Since I am new to c#, please help
JT
These links will tell you how to do that in detail
http://www.c-sharpcorner.com/UploadFile/dwkrueger/BackgroundWorkerSimplified02122008215220PM/BackgroundWorkerSimplified.aspx
http://www.codeproject.com/KB/cpp/BackgroundWorker_Threads.aspx
http://www.c-sharpcorner.com/UploadFile/dwkrueger/BackgroundWorkerSimplified02122008215220PM/BackgroundWorkerSimplified.aspx
http://www.codeproject.com/KB/cpp/BackgroundWorker_Threads.aspx
ASKER
Hi Expert,
I use ThreadPool to create a number of threads on the fly. I don't know how to link
progress bar with threadpool ; with separate thread I know how to do.
Thanks,
JT
I use ThreadPool to create a number of threads on the fly. I don't know how to link
progress bar with threadpool ; with separate thread I know how to do.
Thanks,
JT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Expert,
Thanks for sample code. It's working perfectly.
If I put a Cancel button to allow user to cancel the thred pool if it takes too
long (some problem with dtabase). How can it send envent to trhread pool.
Could you give me a sample example too?
Thanks for your help.
JT
Thanks for sample code. It's working perfectly.
If I put a Cancel button to allow user to cancel the thred pool if it takes too
long (some problem with dtabase). How can it send envent to trhread pool.
Could you give me a sample example too?
Thanks for your help.
JT
ASKER
Hi Expert,
I have two questions:
1- Can I use both Background Worker and ThreadPool at the same time?
2- While usign ThreadPool, I create thousands small threads taks that queries
some data from Mysql, the problem is that I have maximum 25 ManualEvents allowed
to use. Is there other ways rather than use ManualEvent? Since each my small thread
queries data and do some calculation, and save it to its state. When all threads finish
calculations, I display their results in datagridview.
I am looking forward to your help.
Thanks,
JT
I have two questions:
1- Can I use both Background Worker and ThreadPool at the same time?
2- While usign ThreadPool, I create thousands small threads taks that queries
some data from Mysql, the problem is that I have maximum 25 ManualEvents allowed
to use. Is there other ways rather than use ManualEvent? Since each my small thread
queries data and do some calculation, and save it to its state. When all threads finish
calculations, I display their results in datagridview.
I am looking forward to your help.
Thanks,
JT
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
http://dotnetperls.com/backgroundworker
http://msdn.microsoft.com/en-us/library/cc221403%28VS.95%29.aspx
Based on the progress reported by the background worker you can update the progress bar of your dialog box.
Background worker also supports cancellation.