Posts Tagged ‘Vista’

WPF: Vista Blue Highlight Brush

April 17th, 2009

For the WPF application I’m currently working on for work I decided that I wanted to change the style for all ListBoxItems so that they looked a little more like list items in Vista when highlighted, instead of the boring white text on a black background.

So I found this wonderful guide to setting the style for IsSelected ListBoxItems across the application. You can find it here: http://www.uxpassion.com/2008/09/styling-wpf-listbox-highlight-color/

Then, for a nice light-blue, glossy vista look I used this gradient:

<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
    <LinearGradientBrush.GradientStops>
        <GradientStop Offset="0" Color="#FFE3F4FC"/>
        <GradientStop Offset="0.38" Color="#FFD8EFFC"/>
        <GradientStop Offset="0.38" Color="#FFBEE6FD"/>
        <GradientStop Offset="1" Color="#FFA6D9F4"/>
    </LinearGradientBrush.GradientStops>
</LinearGradientBrush>

It’s not perfect, but it looks pretty good. I also gave it a solid LightBlue border with a corner radius of 5. Here’s what the results looked like:
Vista Blue Highlight