I created an image button in WPF with a png file. However, there is always a border outside the button image. Is there a way to get rid of it? I tried to set image'stretch ='fill', borderthickness of the button to 0 but none have worked so far.
Thanks for all the replies. Here is my code. I tried to set things up with a style. What is the difference between my code and your codes down? I am a little bit confused with the contentTemplate and the control template you guys mentioned.
<Style x:Key="TopPositionButtonStyle" TargetType="Button">
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value ="30" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderBrush" Value="SteelBlue" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Background="SteelBlue">
<Image Source="images/button_up.png"
HorizontalAlignment="Center"
Margin="0,0,0,0" Height="30" Width="50"
Stretch="Fill"/>
<TextBlock Text="POSITION"
HorizontalAlignment="Center"
Foreground="White"
Margin="5,5,0,0"/>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>