有人知道如何更改 UI 元素工具提示的字体吗?
这会使得所有位置的工具提示变得非常大:
<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>
如果您想更改特定的工具提示,您可以定义与该工具提示更接近的样式,或者直接在工具提示中放置字体大小。 <Button Content="Hey">
<ToolTipService.ToolTip>
<TextBlock FontSize="64" Text="Hey"/>
</ToolTipService.ToolTip>
</Button>
<TextBox>
<TextBox.ToolTip>
<ToolTip>
<TextBlock FontFamily="Tahoma" FontSize="10" FontWeight="Bold" Text="My tooltip text"/>
</ToolTip>
<TextBox.ToolTip>
</TextBox>
在ToolTip上使用FontFamily
属性