I have a method that collects a lot of data from the DB and computes it… it is quite slow, and probably poorly written… but until I learn how to code it better I decided I will display a progressbar with a label stating “Processing day x” (for all the days in the period it has to process) so the user does not think that has crashed or frozen…
It works OK… until day 5— 6-- or so… then I get the windows spinning symbol and the windows title bar says "(not responding) and stops updating!!
So the whole process takes about a minute… it works ok for a couple of seconds but then the progress bar and its windows will stop updating…
Make a thread subclass that has properties you can set. Grab the info from the UI and set the properties, then run the thread and use the property values you stored rather than asking the interface.
Thanks guys! I’ll do my homework and read what Paul suggested. In the meantime I realized I could refactor,fix and optimize my code to make it run 300% faster. So its not that important anymore.