- Open Visual Studio 2008
- New WPF windows application
- Open window1.xaml file
- Write below given code above <Grid>
<Window.Resources>
<Style x:Key="mystyle" TargetType="Button">
<Setter Property="Background" Value="Orange"/>
<Setter Property="FontStyle" Value="Italic"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Margin" Value="4"/>
</Style>
</Window.Resources>
- Write below code between <Grid>… …</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button Style="{StaticResource mystyle}" Content="Vijay"/>
<Button Style="{StaticResource mystyle}" Content="Raju"/>
<Button Style="{StaticResource mystyle}" Content="Mygo"/>
</StackPanel>
- Execute the program..