I’ve been trying and searching for this one quit a long time now.
Windows added a black (or transparant) border around a button component. The reason for this is that the touch area for the button is a bit larger and thus it’s easier to tap a button.
In my application, I really need to remove that area. I tried a lot but it seems that it’s impossibe. I also tried it in Expression Blend but no luck.
<Style x:Key="ButtonStyleCalendar" TargetType="Button">
<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeSmall}"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0" />
<Setter Property="VerticalContentAlignment" Value="Top" />
</Style>
That is the style that I applied to the button. I tought it would be the margin or padding but that’s not it.
Does anyone has an answer for this? I searched stackoverflow but nobody came up with a solution.
Thanks in advance!
You need to override the
ControlTemplateof the Button and remove theMargin="{StaticResource PhoneTouchTargetOverhang}". Here is the resulting style: