Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm developing a desktop application for certain mathematical computation. I've finished building my application's gui & coding. However, when I run the application and click the button that does the operation, the application does not respond for over 15 minutes. I searched online and saw something on using backgroundworker thread that does the operation and update the progressbar control on the ui. This didn't work as well. The progressbar stops at 2%. The computation is heavy and does several looping. I need advice on what to do.

What I have tried:

I searched online and saw something on using backgroundworker thread that does the operation and update the progressbar control on the ui. This didn't work as well. The progressbar stops at 2%. The computation is heavy and does several looping. I need advice on what to do.
Posted
Updated 10-Jul-16 6:42am

BackgroundWorker is the right way to go: but you have to signal the Progress Bar updates at appropriate points in your task - you can't just start a worker and assume that it will automatically update the progress for you. So look at reporting progress a couple of times in your loops rather than just once at the start and again at the end.
 
Share this answer
 
Here's a link to one of my earliest CP articles; it might provide some help:

ProgressDialog: for executing long-running code with some thread safety[^]

I realize that the article is not up to today's article standards and I would surely report is "extremely poor quality" were it submitted today, but I'm unsure that revamping it would be worthwhile. Please let me know your thoughts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900