Dealing with ProgressBar

  • Thread starter Thread starter kshama.bafna
  • Start date Start date
K

kshama.bafna

Hi All,

I have a .NET CF application using C# language. On a form, I have
created a panel, on which I have placed a label and a progress bar
control. However, when I change the value of the progress bar, the
progree bar moves ahead. In the same method, when I change the text
property of the label, the changed text is not displayed on the UI.
The changed text is displayed only after the application control exits
the method.

Please let me know if I am missing anything.

Regards,
Kshama
 
I have a .NET CF application using C# language. On a form, I have
created a panel, on which I have placed a label and a progress bar
control. However, when I change the value of the progress bar, the
progree bar moves ahead. In the same method, when I change the text
property of the label, the changed text is not displayed on the UI.
The changed text is displayed only after the application control exits
the method.

Sounds like the usual "you are not doing your long processing in a
separate thread" problem.

Use Google Groups to search this newsgroup for a number of previous
discussions on the issue, including at least one recent one I recall
that specifically mentions the progress bar (which apparently forces a
redraw when updated, making it work when other things don't).

The basic idea: you need to use BackgroundWorker to move your processing
to a different thread so that the main UI thread can respond to changes
in the various controls' values (like the text in a Label control).

Pete
 
Thanks a lot Peter. After adding the processing in a separate thread,
things worked. :)
 
Back
Top