3
votes

In the winforms we have a property called continuous that will show the progress bar from 0 till it hits 100.

I was looking for the same effect in WPF but from what I searched it leaded me to change the IsIndeterminate to true which doesnt give me the continuous effect only a weird effect of the part of the progressbar walking around.

To display an example of what I am talking about, the below image represents the continuous effect I am after:

Ilustrative example

Back to the question, how do I do that in WPF ?

3
I don't understand... isn't that what ProgressBar does by default without setting IsIndeterminate? Also, a continuous progress bar is an indeterminate progress bar. Perhaps take a look at this Windows UX guideline for more info on determinate vs indeterminate.BoltClock♦
@BoltClock partially yes but it is divided by blocks and is not continuos.Prix
Looks like you're using Windows XP or the Classic theme in Vista/7 then.BoltClock♦
@BoltClock yes windows xp and CodeNaked answered how to solve it by changing the theme thanks.Prix
"weird effect of the part of the progressbar walking around"? It is so by conventionEvAlex

3 Answers

3
votes

The WPF ProgressBar does not have the Continous option. If you are on XP, or using the Luna themes, you will get the segmented look.

This question describes how the Aero theme can be applied, but otherwise you'd have to restyle the progress bar.

0
votes

How exactly is the pictured progressbar continuous?

What is wrong is IsIndeterminate? What you describe as a "part of the progressbar walking around" is most suitable for a progress bar which does not have a definitive end, if you have a progress bar that fills up the user will expect that the operation is finished when the progress bar is completely filled, if it just starts over that might be quite annoying.

0
votes

You need to set up the Progress bar to IsIndeterminate = false

var progress = new ProgressBar { Height = 50, Width = 300,  
                                 IsIndeterminate = false
                               };

I used that way and works as expected. Are you updating the Value Property?

Update: I think I know what you're problem is: WPF Controls renders differently in XP than Windows 7. In Windows 7 works the way you want, but in XP, uses blocks

You're seeing this :

enter image description here Instead of what you want :(