Click here to Skip to main content
12,747,708 members (41,073 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# WPF
what I'm trying to do is showing tool tip only on tab name (like in browsers), not on whole tab grid. I've searched Google but i have not found nothing interesting. Any idea how to do that?
Posted 3-Dec-12 6:14am
Updated 3-Dec-12 6:15am
Sanket Panchamia 28-May-13 11:32am
I have a code that is as follows
<tabitem name="TabItem4">
<textblock text="U2 - Empty" foreground="Black" margin="0,0,0,0" height="20" verticalalignment="Center" name="txtU2" tooltip="testingTip">

I am not getting the tooltip text. Any comments?
Tapirro 28-May-13 12:07pm
Any error or warnings comming from Visual? For me this solution works perfectly.
Sanket Panchamia 28-May-13 12:29pm
just no tooltip. Thats it

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You are likely setting it on the Tab not the header. Try the header instead. This may require you to restyle the header.
You can restyle the header how ever you want though and then set the tooltip for the UI element you use to display the header.

Something like this should work.

Note: this was not tested so there may be errors in it.

<TabControl x:Name="tabCtrlMain" ItemsSource="{Binding Items}" >
            <Style TargetType="TabItem">
                <Setter Property="Header" Value="{Binding FileName}" />
                <Setter Property="HeaderTemplate">
                        <DataTemplate DataType="{x:Type TabItem}">
                            <Border x:Name="grid">
                                            <TextBlock Text="{TemplateBinding Content}" Tooltip="{Binding Path=TooltInfo}"/>

If you are directly adding tabs in XAML then just code right to the header.


                <!--Place your tooltip content here-->



This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170215.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100