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 7936867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:20:38+00:00 2026-06-03T22:20:38+00:00

I am attempting to implement HotTracking for a tab control in Wpf. My understanding

  • 0

I am attempting to implement HotTracking for a tab control in Wpf. My understanding is this was not included in the wpf tabcontrol and I would like to use it.

For my benefit HotTracking = When mouseover an unselected tab the tab will change color(usually to something between selected and not selected)

I used a bit of my own knowledge and this post How to set MouseOver event/trigger for border in XAML? but I can’t seem to make it work.

This is everything.

<Window x:Class="TestingWpF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="1024" Width="1280">
<Window.Resources>
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border 
                            Name="Border"
                            CornerRadius="6,6,0,0" >
                            <ContentPresenter x:Name="ContentSite"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            ContentSource="Header"
                            Margin="12,2,12,2"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="LightBlue" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="AliceBlue" />
                        </Trigger>
                        <Trigger Property=" Border.IsMouseOver" Value="True">
                            <Setter Property="Border.Background" Value="Green" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>


<Grid>
    <TabControl Grid.ColumnSpan="2" Grid.RowSpan="2" Height="309" HorizontalAlignment="Left" Name="tabControl1" VerticalAlignment="Top" Width="781" Padding="0">
        <TabItem Header="tabItem1" >

        </TabItem>
        <TabItem Header="tabItem2" >

            </TabItem>
     </TabControl>
    </Grid>
</Window>
  • 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-06-03T22:20:41+00:00Added an answer on June 3, 2026 at 10:20 pm

    I figured it out, my problem was this section

    <Trigger Property="IsSelected" Value="True">
       <Setter TargetName="Border" Property="Background" Value="LightBlue" />
    </Trigger>
    <Trigger Property="IsSelected" Value="False">
      <Setter TargetName="Border" Property="Background" Value="AliceBlue" />
    </Trigger>
    <Trigger Property=" Border.IsMouseOver" Value="True">
    //Change this line 
    //<Setter Property="Border.Background" Value="Green" />    
    //To This
      <Setter TargetName="Border" Property="Background" Value="Green" />
    </Trigger>
    

    The last Trigger was the one not working. And if you notice I used different properties in the setter. I changesd it to match the other two and it worked

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to implement a Save/Load feature into my small game. To accomplish this
How can I use arrays in Scheme? In particular, I'm attempting to implement a
I am attempting to implement DragAndDrop for an ImageControl in WPF. I add the
I'm attempting to implement a custom search dialog in a WPF program. The Parent
I am attempting to implement a quiet uninstall of my application. This works great
I'm attempting to implement a specific type of version control for several of my
I am attempting to implement a WPF ViewModel using Castle Windsor Dynamic Proxies. The
I am attempting to implement a custom view. This view should display an image
I am attempting to implement the suckerfish menu found on this tutorial. I get
Attempting to implement a poor man's test of whether a process is still running

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.