I am trying to find the default style for the KeyTip
control; so I can just change the default values and make my own KeyTip
Style. But I've had no luck at finding it.
So I've tried this:
<Style x:Key="MainKeyTipStyle" TargetType="KeyTipControl" >
<Setter Property="Background" Value="Green"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Effect" Value="{x:Null}"/>
</Style>
on a normal button:
<Button
x:Name="buttonTEST"
Content="_TEST"
KeyTipService.KeyTip="T"
KeyTipService.KeyTipStyle="{StaticResource MainKeyTipStyle}"
Click="buttonTEST_Click"
/>
When I run my test and press Alt it ends up looking like this:
I would like a solid background color. Not a gradient / fade effect as in my test. How can I get rid of this default effect?
Any help would be appreciated.
Here are links I've looked at but didn't find helpful:
Set the Template
property to a custom ControlTemplate
in your KeyTipControl
style:
<Style x:Key="MainKeyTipStyle" TargetType="KeyTipControl" >
<Setter Property="Background" Value="Green"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Effect" Value="{x:Null}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="KeyTipControl">
<Border Name="OuterBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<TextBlock Text="{TemplateBinding Text}" HorizontalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The default one contains two Border
elements.