Search code examples
wpfimagetooltiptextblock

Add image into a tooltip


I have some TextBlocks with tooltips and I'd like to add an image into the tooltips (that means, I'd like to have tooltips with text and images).

Does anybody knows how could I do that in a simple way?

Thanks a lot!


Solution

  • This is one way to approach it:

    <TextBlock>
        <TextBlock.ToolTip>
            <StackPanel Orientation="Horizontal">
                <Image Source="images/Item 2.gif" />
                <TextBlock>My tooltip text</TextBlock>
            </StackPanel>
         </TextBlock.ToolTip>
    
        Here is my text.
    </TextBlock>