Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tooltip font in wpf

Tags:

wpf

fonts

tooltip

Does anybody know how to change the font of tooltip for ui elements?

like image 999
Alex James Avatar asked Feb 25 '10 12:02

Alex James


People also ask

How to add ToolTip in WPF?

Basic WPF ToolTip ExampleDrag a Button control from the toolbox and drop it. Add a ToolTip property to the button with a message you want to show on mouse hover of the button.

How to add ToolTip to image in WPF?

In this article we will see how we can Bind an Image to the Tooltip of an Image. Fire up Visual Studio 2008 and Create a WPF Application and name the project as ImageTooltipInWPF. Tooltip on the top as it's preview. So let's have a ListBox and then we will bind the images onto it.

How do I add ToolTip to XAML?

Use the Placement property or ToolTipService. Placement attached property to place the ToolTip above, below, left, or right of the pointer. You can set the VerticalOffset and HorizontalOffset properties to change the distance between the pointer and the ToolTip.

What is TextBlock WPF?

The TextBlock control provides flexible text support for UI scenarios that do not require more than one paragraph of text. It supports a number of properties that enable precise control of presentation, such as FontFamily, FontSize, FontWeight, TextEffects, and TextWrapping.


1 Answers

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>
like image 57
Anvaka Avatar answered Oct 06 '22 01:10

Anvaka