custom progressbar, problem updating it.
-
I've tried to create a custom progressbar to display while I'm doing some intensive work. I also want to update a string of what is currently going on, like an installer tells the user what file is currently being copied, and so on... So, I have a form that I display and then call methods like
MyProgressForm.setProgressText(string) MyProgressForm.setProgress(int)
but the GUI components (a label for the text and a custom-painted control for the progress) won't get updated, I guess because there is too much work going on... So my question is, how do I force these to be updated? What is the best way to solve this? thankful for some help, I can't seem to figure it out ... -
I've tried to create a custom progressbar to display while I'm doing some intensive work. I also want to update a string of what is currently going on, like an installer tells the user what file is currently being copied, and so on... So, I have a form that I display and then call methods like
MyProgressForm.setProgressText(string) MyProgressForm.setProgress(int)
but the GUI components (a label for the text and a custom-painted control for the progress) won't get updated, I guess because there is too much work going on... So my question is, how do I force these to be updated? What is the best way to solve this? thankful for some help, I can't seem to figure it out ...Calling the
Update
method of your ProgressBar after changing its Value or Text should solve the problem.
-
I've tried to create a custom progressbar to display while I'm doing some intensive work. I also want to update a string of what is currently going on, like an installer tells the user what file is currently being copied, and so on... So, I have a form that I display and then call methods like
MyProgressForm.setProgressText(string) MyProgressForm.setProgress(int)
but the GUI components (a label for the text and a custom-painted control for the progress) won't get updated, I guess because there is too much work going on... So my question is, how do I force these to be updated? What is the best way to solve this? thankful for some help, I can't seem to figure it out ...You should be doing the lengthy processor intensive work in a thread seperate from the main gui thread. Start a worker thread and do your lengthy work there. Update the progress bar's values from the worker thread. The main window thread will then keep your bar painted properly.