Reputation: 4673
I can't work out how to get rid of the margin around a button's content. Here is some example XAML:
<Button Background="Red" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Grid Background="Blue" Margin="0">
<TextBlock Text="me" Padding="0"></TextBlock>
</Grid>
</Button>
I can't seem to get rid of the red bit. Has anyone got any ideas?
Upvotes: 1
Views: 6155
Reputation: 1621
You need to change the control template for the button. You can have alook at the following links http://mark-dot-net.blogspot.com/2007/07/creating-custom-wpf-button-template-in.html http://msdn.microsoft.com/en-us/magazine/cc163497.aspx
Upvotes: 2