The Cool Windows 7 Selection in XAML

Aug 26, 2009

Here's the XAML to make a selection rectangle similar to the one in Win7:

        <Grid Height="22" Width="300" > 
            <Rectangle Stroke="#FF7DA2CE" RadiusX="2" RadiusY="2">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFDCEBFC" Offset="0" />
                        <GradientStop Color="#FFC1DBFC" Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <Rectangle Margin="1" Stroke="#FFEBF4FD" RadiusX="2" RadiusY="2" Fill="{x:Null}">
            </Rectangle>
        </Grid>

 

      

nokola.com | Terms | Log in

Recent

About the author

Happy & enjoying life. Software enthusiast.
The opinions I express here and on nokola.com are mine and not my employeer's (Microsoft).
This is the official blog of nokola.com. You can find Silverlight samples, coding stuff, and hopefully other interesting things here.