Progress bar style in WPF is old fashioned. Increments in Bars. How to implement a progress bar with vista or windows-7 shady glow effect ?
Image http://quickshare.my3gb.com/download/2.JPG
Even checked out the properties of the Progressbar. But, there is no properties related to glowy effect.
Also, is there any animations or something different from normal progress bar/
Thanks in Adv.
Edit The Code
<ProgressBar Height="41" HorizontalAlignment="Left" Margin="372,215,0,0" Name="progressBar1" VerticalAlignment="Top" Width="150">
</ProgressBar>
You need to be using the Aero theme (i.e. Windows 7 Basic, or Windows 7) in your Personalization settings of Windows in order to get the smooth progress bar and animated glow look.
Vista and Windows 7 have the Aero theme. It didn't even exist when Windows XP was released. It was also removed in Windows 8 for a more standard look across the board. If you switch to Windows Classic then you get the old chunky bars look for the progress bar.
WPF has a different set of Templates defined for Luna, Aero, Royale, Classic.....what it does is look at the theme your system is currently using, and then this makes it decide which set of WPF Templates to use.
So when you are on XP, it never gets the opportunity to use the Aero set of templates.
If for some reason you want to have your progress bar themed with the Aero look even when Windows is not using the Aero theme then there are 2 main solutions.
The solutions:
You can force your WPF application to use the Aero-themed WPF templates for all of its controls:
http://arbel.net/2006/11/03/forcing-wpf-to-use-a-specific-windows-theme/
http://www.kennethham.com/wp/2010/11/force-wpf-to-use-windows-7aero-theming-in-classic-mode/
OR
If you don't want all of your applications controls to be themed as Aero, then just take the style/template that defines the Aero look of the ProgressBar from the Aero theme resources and apply it to your ProgressBar.
Hopefully either way will get you your glowing progress bar....note, I don't have XP to test if this is the case.
You can mimic the animation using the following, which is a tweak for the accepted answer:
Preview:
Roll your own shouldn't be too hard.
Create a usercontrol which has the properties of a standard progress bar
You can create a derived property which calculates the size of the bar by using the a formula:
Which changes when the Value, Maximum or Minimum is updated
Bind this to the Width of the 'bar' in your progress bar control template - this way when the Value property is updated, the progress bar will resize.
How your bar looks is up to you, but I guess you just want a load of fancy fills/gradients/glow effects - you can add these in Blend
Disclaimer: Formulas may be incorrect!
In case you want to try and roll your own, here's one I just knocked up which seems to work ok
The XAML
The result:
Like I said, something like this is pretty easy but still consider redefining the template or using the original since it does support glowyness on the right OS
Here it is after I added a 'Percent' dependency property and bound to that in the control template:
Code for updating
Percent
wasEdit 2:
I messed with the fills and added a white inner border so it looks more shiny. The only thing missing is the shiny animation
the top one is my control, the bottom one is the default WPF one
Bear in mind, all of this may be possible just by editing the progress bar control template
Here's the updated XAML:
If you want to change the look of the Progress Bar, you'll have to re-define its (Control)Template.
ms explains this here :
http://msdn.microsoft.com/en-us/library/ms750638.aspx
When writing the Template, to get the glow, You can use the BitmapEffect, with a OuterGlowBitmapEffect (!Software rendered), but Best is to use Effect (more up to date).
Maybe you don't have to redefine the Template if you use the Effect of the progress bar and it suits you.
Notice that you have good free themes for your application on the net.