none
WPF continuous progress bar

    Question

  • Hello,

    Is there an easy way (or any way) to get a solid WPF progress bar instead of the blocked effect?  In a Windows.Forms progress bar you just set the style to Continuous. I've searched and haven't been able to find something equivalent for WPF.  Thanks.


    genush
    Friday, September 23, 2011 5:17 PM

Answers

All replies

  • Hello genush,

    you should set IsIndeterminate = True. Good luck.

    Friday, September 23, 2011 5:26 PM
  • Hello,

    When I set IsIndeterminate = true, that runs the progress bar continuously but the style is still blocks and not a solid bar.


    genush
    Friday, September 23, 2011 5:51 PM
  • Hello,

    When I set IsIndeterminate = true, that runs the progress bar continuously but the style is still blocks and not a solid bar.


    genush
    Friday, September 23, 2011 5:51 PM
  • You need to restyle the control template to achieve any look you want.

     

    http://stackoverflow.com/questions/82365/smooth-progressbar-in-wpf


    Michael Stacie

    Friday, September 23, 2011 6:31 PM
  • You can define the control template for progress bar to get whatever effect you want. But make sure there are three PART template while defining the control template for progress bar.

    PART_Track. It is used to define the track (the whole area) of the progress bar. You can even modify this to make it something else other than plan rectangle.

     

    PART_Indicator. It is used to do all the calculation for you. It calculates the correct height (in case of vertical progress bar) or width (in case of horizontal progress bar).

     

    PART_Glow: It is used to display the animation and glow effect on the progress bar. If you don't need animation effect then you can simply ignore this.

     

    Here is one example to define control template of progress bar without defining the glow effect.

    ProgressBar.Template>
        <ControlTemplate>
            <Grid Background="{TemplateBinding Background}">
                <Border Name="PART_Track"/>
                <Border Name="PART_Indicator" 
                        HorizontalAlignment="Left" 
                        Background="{TemplateBinding Foreground}"/>
            </Grid>
        </ControlTemplate>
    </ProgressBar.Template>
    

     

    You can see the complete example here

    http://zamjad.wordpress.com/2011/08/31/part-control-template/

     

    Regards

    Zeeshan Amjad

    http://zamjad.wordpress.com/

     

     


    http://zamjad.wordpress.com
    Friday, September 23, 2011 6:45 PM
  • You can change the look and feel of the progress bar according to your requirement by changing style of ProgressBar.

    You can find few options from WPF Themes of codeplex

    http://wpf.codeplex.com/wikipage?title=WPF%20Themes


    Gaurav Khanna | http://gauravkhanna.blog.co.in
    • Marked as answer by genush Friday, September 23, 2011 10:04 PM
    Friday, September 23, 2011 6:50 PM