Mega Code Archive

 
Categories / VB.Net / WPF
 

Override Style Properties

<Window x:Class="WpfApplication1.Window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="WPF" Height="120" Width="240">       <Window.Resources>         <Style TargetType="{x:Type Button}">             <Setter Property="Margin" Value="4"/>             <Setter Property="Width" Value="80"/>             <Setter Property="Height" Value="24"/>             <Setter Property="FontWeight" Value="Bold"/>         </Style>     </Window.Resources>     <Grid Margin="20">         <StackPanel Orientation="Horizontal">             <Button>One</Button>             <Button FontWeight="Thin">Two</Button>         </StackPanel>     </Grid> </Window>