<UserControl.Resources> <Style x:Key="MyBtnStyle" TargetType="{x:Type Button}"> <Setter Property="FontSize" Value="12" /> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="Foreground" Value="Red" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Width" Value="20" /> <Setter Property="Content" Value="X"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="BorderThickness" Value="1"/> <Setter Property="BorderBrush" Value="#FF2B3C59"/> <Setter Property="Background" Value="Green"/> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter Property="BorderThickness" Value="2"/> <Setter Property="BorderBrush" Value="#FF2B3C59"/> </Trigger> </Style.Triggers> </Style> </UserControl.Resources>
<Button Style="{StaticResource MyBtnStyle}" Name="button1" Click="button1_Click" ></Button>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)