Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

Style applied to a Button element

<Page     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">     <Page.Resources>         <Style x:Key="MyStyle">            <Setter Property="Control.Background" Value="Red" />            <Setter Property="Control.Foreground" Value="White" />            <Setter Property="Control.Width" Value="100" />         </Style>     </Page.Resources>     <StackPanel>         <Button Style="{StaticResource MyStyle}" Content="A Red Button"/>     </StackPanel> </Page>