Make tab same color as the tab content in WPF

Posted on 2009-04-21
Last Modified: 2013-11-12
I am trying to make the selected tab to be same color as the tab content and the other tab to be gray out.

For example in the attached image, I would like to make 'First' tab blue as the content is blue too.

Does anyone what I need to do that.  Thanks
<Window x:Class="tbTest.Window1"



    Title="Window1" Height="300" Width="300">


        <Style TargetType="TabControl" x:Key="SelectedBackgroundStyle">

            <Setter Property="Background"

                    Value="{Binding SelectedItem.Background, RelativeSource={x:Static RelativeSource.Self}}">





        <TabControl x:Name="Tabs" Style="{StaticResource SelectedBackgroundStyle}" Margin="36,60,37,12">

            <TabItem Header="First" Background="Blue">

                <TextBlock Height="144" Width="257">Test</TextBlock>


            <TabItem Header="Second" Background="Green"/>

            <TabItem Header="Third"  Background="Orange"/>




Open in new window

Question by:xewoox
    1 Comment
    LVL 8

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
    zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now