Articles in categories

Articles

Make WPF button look flat

This is how to give a WPF Button a flat look:

Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}

 

Original button

 

 

 

Button with style

 

 

 

Ofcourse you can always  restyle your entire button with creating your own style, but this one already exists and did what I needed it to do, make the button look flat.

My full button code:

<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
	Height="17"
	Width="17"
	HorizontalAlignment="Center"
	Command="{Binding CloseTabCommand}">
  <Button.Content>
	<Image Source="{StaticResource CloseImg}" />
  </Button.Content>
</Button>