WPF Tooltip control: Tips & Tricks

08 Mar

1. How to add multi-line tooltip?
For button control, you can wrap the tooltip string in a TextBlock element, and then use either <LineBreak/> or &#x0a in the tooltip string.

image  image

image  image

If you set the tooltip using code, you can directly use “\n” in the tooltip text, :




2. How to add bolded texts to the tooltip?
Use <Run> element.

image     image 

3. How to add images to the tooltip?
Use <InlineUIContainer> and <Image> elements.

image  image

1 Comment

Posted by on March 8, 2013 in Dotnet/C#


Tags: , , , , , , , ,

One response to “WPF Tooltip control: Tips & Tricks

  1. Stephan

    August 23, 2014 at 10:42 am

    How can I do bold, newlines, etc when getting text from a (language) resource file. I can get the text, but it isn’t interpreted. Ex:
    where ‘ListToolTip’ has several lines of text and a few bold phrases, for example.

    Example output:
    Line 1 of text\n
    Line 2 with bold text\n
    Line 3 of text.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: