---
title: "Progress Bar control in WPF"  
description: "ProgressBar  elements in XAML is used to create a progress bar control in WPF. We can use concept of progress bar control when we want to show some ba"  
author: "Anonymous User"  
published: 2011-04-04  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/533/progress-bar-control-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# Progress Bar control in WPF

<ProgressBar /> [elements](https://www.mindstick.com/forum/1440/wpf-button-with-multiple-text-elements) in XAML is used to create a [progress bar](https://www.mindstick.com/articles/12747/android-progress-bar) [control](https://yourviews.mindstick.com/view/83439/bipartisan-gun-control-bill-passed-in-us-after-decades) in WPF. We can use [concept](https://www.mindstick.com/blog/79/routing-concept-in-dot-net) of progress bar control when we want to show some [background processing](https://answers.mindstick.com/qa/99879/how-does-android-handle-background-processing-and-multitasking) or want to show status of large calculating job, then we use concept of progress bar control.\

##### Some properties related with Progress Bar control

- **X: Name**—x: Name [property](https://www.mindstick.com/articles/198559/an-ownership-of-property-in-hua-hin) is used to set a unique identifier to your progress bar control.
- **Width**—Width property are used to set width of your progress bar control.
- **Height**—Height property are used to set height of your progress bar control.
- **Value**—Value property is used to set or get value of progress bar.
- **VerticalAlignment**—VerticalAlignment property is used to set [vertical](https://www.mindstick.com/forum/12951/how-to-fix-bootstrap-tab-vertical-with-text) alignment of your progress bar control.
- **HorizontalAlignment**—HorizontalAlignment property is used to set horizontal alignment of your progress bar control.

##### A XAML code snippet represents a Progress Bar control

```
<Grid>        <ProgressBar Height="25" HorizontalAlignment="Left" Margin="66,113,0,0" Name="progressBar1" VerticalAlignment="Top" Width="379" Value="0" /></Grid>
```

##### Output of the above code snippet is as follows

![Progress Bar control in WPF](https://www.mindstick.com/mindstickarticle/85699cca-5a49-4ae9-a7bb-56ec1311d5f9/images/152c824d-98a0-4178-a7e5-65b93a15a5b1.png)

On the load event of window write the following code to change value of the progress bar.

```
private void Window_Loaded(object sender,  RoutedEventArgs e){            Duration dd =  new Duration(new TimeSpan(10));  //creating an object of the duration class.            DoubleAnimation da = new DoubleAnimation(30.0, dd);   //Creating an object of the double animation class.            progressBar1.BeginAnimation(ProgressBar.ValueProperty, da);   //Begin the animation in progress bar control.}
```

##### Output of the following code snippet is as follows

![Progress Bar control in WPF](https://www.mindstick.com/mindstickarticle/85699cca-5a49-4ae9-a7bb-56ec1311d5f9/images/e688fbc4-2181-4d8e-97ad-5f76cb9097f9.png)

---

Original Source: https://www.mindstick.com/articles/533/progress-bar-control-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
