I have styled a tooltip like
<Setter Property="ToolTip">
<Setter.Value>
<Border Background="Red" CornerRadius="5" Padding="5" Margin="0">
<TextBlock Text="Hello" Foreground="White" />
</Border>
</Setter.Value>
</Setter>
And it gets rendered like
Whats that white "rectangle" about? How can I get rid of it
That rectangle comes from the ControlTemplate
of the ToolTip
control wich will contain whatever you set in Control.ToolTip
. You have to override it:
<Style TargetType="ToolTip">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Have you tried reducing the padding of the tooltip directly:
<ToolTip Padding="0" >
...
</Tooltip>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With