tags:

views:

596

answers:

2

How can I create a a custom button that looks and feels like Vista close button? Can any one have a template?

A: 

I don't really know whether it's that what you mean: http://www.megaupload.com/?d=U6TSKHJV

A Vista-Close-Button for a website with simple JS for command to close the window or tab, CSS and HTML.

+1  A: 

This template will helps to make a Vista style Window close button

    <Button>
    <Button.Template>
        <ControlTemplate TargetType="Button">
            <Rectangle Width='60' Height='40' x:Name='MyRectangle'>
                <Rectangle.Fill>
                    <LinearGradientBrush x:Key="RedButtonBackground" StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Offset="0" Color="#F89C8C" />
                        <GradientStop Offset="0.45" Color="#D47F75" />
                        <GradientStop Offset="0.45" Color="#C04C3C" />
                        <GradientStop Offset="1" Color="#C98172" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName='MyRectangle' Property="Fill" >
                        <Setter.Value>
                            <LinearGradientBrush x:Key="RedButtonMouseOverBackground" StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Offset="0" Color="#F89C8C" />
                                <GradientStop Offset="0.45" Color="#E36A53" />
                                <GradientStop Offset="0.45" Color="#C72B0E" />
                                <GradientStop Offset="0.75" Color="#D44310" />
                                <GradientStop Offset="1" Color="#F5E478" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Button.Template>
</Button>
Sauron