Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:22:24+00:00 2026-05-23T14:22:24+00:00

I want to create a WPF tooltip containing a label for the header of

  • 0

I want to create a WPF tooltip containing a label for the header of the tooltip and then a textblock containing more detailed text. I’ve created the following style in a resource dictionary:

<Style x:Key="AppToolTip"
   TargetType="ToolTip">
<Setter Property="OverridesDefaultStyle" Value="true" />    
<Setter Property="Template">
        <Setter.Value>

            <ControlTemplate TargetType="ToolTip">
                <StackPanel>
                    <Label Content="{TemplateBinding Content}" FontWeight="Bold" Background="Blue" Foreground="White">

                    </Label>
                    <TextBlock Padding="10" TextWrapping="WrapWithOverflow" Width="200">

                    </TextBlock>
                </StackPanel>
            </ControlTemplate>
        </Setter.Value></Setter>
</Style>

And can successfully apply this style to a button like so and have the tooltip header appear:

<Button.ToolTip>
<ToolTip Style="{DynamicResource PalletToolTip}">
                    <Binding Source="{x:Static ResStrings.New}"/>
                </ToolTip>
</Button.ToolTip>

What i’m stuck on is how can i set the content of the extra descriptive text from the usage above ? I’m already data binding to the Content property when showing the tooltip header.
Anyone who’s read Adam Nathan’s WPF Unleashed book will recognise that i’m using his example tooltip XAML but in his case, he’s used hard coded strings for the content of the label and textblock. I want to create something that’s more reusable and hence want to use data binding to achieve the same effect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:22:25+00:00Added an answer on May 23, 2026 at 2:22 pm

    I would inherit a HeaderedToolTip class from ToolTip and add a Header property. I would specify the template for that control much as you’ve done. Then I would be able to use it like so:

    <Button>
        <Button.ToolTip>
            <HeaderedToolTip Header="My Title" Content="My Content"/>
        </Button.ToolTip>
    </Button>
    

    Or, with bindings:

    <Button>
        <Button.ToolTip>
            <HeaderedToolTip Header="{Binding ToolTipTitle}" Content="{Binding ToolTipText}"/>
        </Button.ToolTip>
    </Button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to achieve the following: Create a WPF DataGrid that have 2 columns:
I want to create a Style for a WPF ListBox that includes a Button
I want to create a DataGrid in WPF and i want to add text
So I create a WPF Window manually, and then want to load an existing
I want to create a ColumnSeries Bar Chart in WPF using C#. I shall
In WPF, I want to create a hyperlink that navigates to the details of
I've created a WPF UserControl which contains a Button. I now want any consumer
I created a grid in procedural code on my WPF page. Now I want
I want to create a WPF control that contains elements (rectangles and ellipses) that
I want to create a WPF control similar to the example below. Check out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.