title: Tab Item and Tab Control Border Style
body: <p>How do I style the Tab Control Border so that the selected Tab Item does not have a line underneath it?</p>
  
  <p><img src="https://i.stack.imgur.com/8DGDr.jpg" alt="WPF Tab Item"></p>
  
  <p>These are my Tab Control and Tab Item styles so far.</p>
  
  <pre><code>&lt;!-- Tab control styling --&gt;
          &lt;Style TargetType="{x:Type TabControl}"&gt;
              &lt;Setter Property="Padding" Value="10,5,10,5" /&gt;
              &lt;Setter Property="Margin" Value="3.5" /&gt;
              &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" /&gt;
          &lt;/Style&gt;
          &lt;!-- Tab item styling --&gt;
          &lt;Style TargetType="{x:Type TabItem}"&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type TabItem}"&gt;
                          &lt;Grid&gt;
                              &lt;Border 
                                   Name="Border"
                                   Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                                   BorderBrush="Black" 
                                   BorderThickness="1,1,1,0" 
                                   CornerRadius="3,3,0,0"
                                   MinWidth="120"&gt;
                                      &lt;ContentPresenter x:Name="ContentSite"
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          ContentSource="Header"
                                          Margin="12,2,12,2"/&gt;
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsFocused" Value="True" &gt;
                                  &lt;Setter Property="Background" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" /&gt;
                                  &lt;Setter Property="HeaderTemplate"&gt;
                                      &lt;Setter.Value&gt;
                                          &lt;DataTemplate&gt;
                                              &lt;TextBlock FontWeight="Bold" Text="{Binding}"/&gt;
                                          &lt;/DataTemplate&gt;
                                      &lt;/Setter.Value&gt;
                                  &lt;/Setter&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsMouseOver" Value="True" &gt;
                                  &lt;Setter Property="Background" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" /&gt;
                                  &lt;Setter Property="HeaderTemplate"&gt;
                                      &lt;Setter.Value&gt;
                                          &lt;DataTemplate&gt;
                                              &lt;TextBlock FontWeight="Bold" Text="{Binding}"/&gt;
                                          &lt;/DataTemplate&gt;
                                      &lt;/Setter.Value&gt;
                                  &lt;/Setter&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsSelected" Value="True" &gt;
                                  &lt;Setter Property="Background" TargetName="Border" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" /&gt;
                                  &lt;Setter Property="HeaderTemplate"&gt;
                                      &lt;Setter.Value&gt;
                                          &lt;DataTemplate&gt;
                                              &lt;TextBlock FontWeight="Bold" Text="{Binding}"/&gt;
                                          &lt;/DataTemplate&gt;
                                      &lt;/Setter.Value&gt;
                                  &lt;/Setter&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>If I can achieve the look displayed in the screenshot without having to overload the tab item control template then I don't have an issue as the default tab item template doesn't have the line underneath it on the selected tab. I haven't been able to do this so far. Thanks for your help. </p>