Hi everybody.
Does anybody know how to change the font of tooltip for ui elements?
Hi everybody.
Does anybody know how to change the font of tooltip for ui elements?
FontFamily - Gets or sets the font family of the control. This is a dependency property. (Inherited from Control.)
FontSize - Gets or sets the font size. This is a dependency property. (Inherited from Control.)
FontStretch - Gets or sets the degree to which a font is condensed or expanded on the screen. This is a dependency property. (Inherited from Control.)
FontStyle - Gets or sets the font style. This is a dependency property. (Inherited from Control.)
FontWeight - Gets or sets the weight or thickness of the specified font. This is a dependency property. (Inherited from Control.)
From the WPF documentation
This gives you really big tooltips in all places:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<Style x:Key="{x:Type ToolTip}" TargetType="{x:Type ToolTip}">
<Setter Property="FontSize" Value="24"/>
</Style>
</Page.Resources>
<Grid>
<Button Content="Hey" ToolTipService.ToolTip="Hey"/>
</Grid>
</Page>
If you want to change particular tooltip you can define style closer to that tooltip, or place fontsize directly in the tooltip:
<Button Content="Hey">
<ToolTipService.ToolTip>
<TextBlock FontSize="64" Text="Hey"/>
</ToolTipService.ToolTip>
</Button>
You can do it by adding textblock as tooltip's child element
<TextBox>
<TextBox.ToolTip>
<ToolTip>
<TextBlock FontFamily="Tahoma" FontSize="10" FontWeight="Bold" Text="My tooltip text"/>
</ToolTip>
<TextBox.ToolTip>
</TextBox>