title: How to have two editable TextBoxes in Combobox content template?
body: <p>I want to have two <code>TextBoxe</code>s in <code>ComboBox</code> template as shown in the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/FTGOB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FTGOB.png" alt=""></a></p>
  
  <p>I have modified control template from <strong>MSDN</strong>. This has a problem: I am not able to tab the inner <code>TextBoxe</code>s!</p>
  
  <p>Is it right to have multiple <code>TextBoxe</code>s in single <code>TextBox</code>?</p>
  
  <p>If the answer would be NO, then what would be best control to replace <code>TextBox</code>? </p>
  
  <h2>Code:</h2>
  
  <pre><code>&lt;UserControl x:Class="SearchableListBox_keyNavigator.TrackNameControl"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:local="clr-namespace:SearchableListBox_keyNavigator"
               mc:Ignorable="d" 
               d:DesignHeight="450" d:DesignWidth="800"&gt;
      &lt;UserControl.Resources&gt;
                &lt;LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill"
                       StartPoint="0,0"
                       EndPoint="1,0"&gt;
              &lt;LinearGradientBrush.GradientStops&gt;
                  &lt;GradientStopCollection&gt;
                      &lt;GradientStop Color="#000000FF"
                      Offset="0" /&gt;
                      &lt;GradientStop Color="White"
                      Offset="0.4" /&gt;
                      &lt;GradientStop Color="MintCream"
                      Offset="0.6" /&gt;
                      &lt;GradientStop Color="#000000FF"
                      Offset="1" /&gt;
                  &lt;/GradientStopCollection&gt;
              &lt;/LinearGradientBrush.GradientStops&gt;
          &lt;/LinearGradientBrush&gt;
          &lt;ControlTemplate x:Key="ComboBoxToggleButton"
                   TargetType="{x:Type ToggleButton}"&gt;
              &lt;Grid&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition /&gt;
                      &lt;ColumnDefinition Width="20" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;VisualStateManager.VisualStateGroups&gt;
                      &lt;VisualStateGroup x:Name="CommonStates"&gt;
                          &lt;VisualState x:Name="Normal" /&gt;
                          &lt;VisualState x:Name="MouseOver"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                  (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                            Storyboard.TargetName="Border"&gt;
                                      &lt;EasingColorKeyFrame KeyTime="0"
                                     Value="{StaticResource ControlPressedColor}" /&gt;
                                  &lt;/ColorAnimationUsingKeyFrames&gt;
                              &lt;/Storyboard&gt;
                          &lt;/VisualState&gt;
                          &lt;VisualState x:Name="Pressed" /&gt;
                          &lt;VisualState x:Name="Disabled"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                  (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                            Storyboard.TargetName="Border"&gt;
                                      &lt;EasingColorKeyFrame KeyTime="0"
                                     Value="{StaticResource DisabledControlDarkColor}" /&gt;
                                  &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).
                  (SolidColorBrush.Color)"
                                            Storyboard.TargetName="Arrow"&gt;
                                      &lt;EasingColorKeyFrame KeyTime="0"
                                     Value="{StaticResource DisabledForegroundColor}" /&gt;
                                  &lt;/ColorAnimationUsingKeyFrames&gt;
                                  &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderBrush).
                  (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                            Storyboard.TargetName="Border"&gt;
                                      &lt;EasingColorKeyFrame KeyTime="0"
                                     Value="{StaticResource DisabledBorderDarkColor}" /&gt;
                                  &lt;/ColorAnimationUsingKeyFrames&gt;
                              &lt;/Storyboard&gt;
                          &lt;/VisualState&gt;
                      &lt;/VisualStateGroup&gt;
                      &lt;VisualStateGroup x:Name="CheckStates"&gt;
                          &lt;VisualState x:Name="Checked"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).
                  (GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                            Storyboard.TargetName="Border"&gt;
                                      &lt;EasingColorKeyFrame KeyTime="0"
                                     Value="{StaticResource ControlPressedColor}" /&gt;
                                  &lt;/ColorAnimationUsingKeyFrames&gt;
                              &lt;/Storyboard&gt;
                          &lt;/VisualState&gt;
                          &lt;VisualState x:Name="Unchecked" /&gt;
                          &lt;VisualState x:Name="Indeterminate" /&gt;
                      &lt;/VisualStateGroup&gt;
                  &lt;/VisualStateManager.VisualStateGroups&gt;
                  &lt;Border x:Name="Border"
              Grid.ColumnSpan="2"
              CornerRadius="2"
              BorderThickness="1"&gt;
                      &lt;Border.BorderBrush&gt;
                          &lt;LinearGradientBrush EndPoint="0,1"
                               StartPoint="0,0"&gt;
                              &lt;GradientStop Color="{DynamicResource BorderLightColor}"
                          Offset="0" /&gt;
                              &lt;GradientStop Color="{DynamicResource BorderDarkColor}"
                          Offset="1" /&gt;
                          &lt;/LinearGradientBrush&gt;
                      &lt;/Border.BorderBrush&gt;
                      &lt;Border.Background&gt;
  
                          &lt;LinearGradientBrush StartPoint="0,0"
                               EndPoint="0,1"&gt;
                              &lt;LinearGradientBrush.GradientStops&gt;
                                  &lt;GradientStopCollection&gt;
                                      &lt;GradientStop Color="{DynamicResource ControlLightColor}" /&gt;
                                      &lt;GradientStop Color="{DynamicResource ControlMediumColor}"
                              Offset="1.0" /&gt;
                                  &lt;/GradientStopCollection&gt;
                              &lt;/LinearGradientBrush.GradientStops&gt;
                          &lt;/LinearGradientBrush&gt;
  
                      &lt;/Border.Background&gt;
                  &lt;/Border&gt;
                  &lt;Border Grid.Column="0"
              CornerRadius="2,0,0,2"
              Margin="1" &gt;
                      &lt;Border.Background&gt;
                          &lt;SolidColorBrush Color="{DynamicResource ControlLightColor}"/&gt;
                      &lt;/Border.Background&gt;
                  &lt;/Border&gt;
  
                  &lt;Path x:Name="Arrow"
            Grid.Column="1"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
             Data="M2.33496 0.802746C2.33496 0.397737 2.66329 0.0694122 3.06829 0.0694122C3.4733 0.0694122 3.80163 0.397737 3.80163 0.802746V2.06941H6.54004V0.802746C6.54004 0.397737 6.86836 0.0694122 7.27337 0.0694122C7.67838 0.0694122 8.00671 0.397737 8.00671 0.802746V2.06941H9.41028C9.68643 2.06941 9.91029 2.29327 9.91029 2.56941C9.91029 2.84555 9.68643 3.06941 9.41029 3.06941H8.00671V5.56941H9.41028C9.68643 5.56941 9.91029 5.79327 9.91029 6.06941C9.91029 6.34555 9.68643 6.56941 9.41029 6.56941H8.00671V9.06941H9.41028C9.68643 9.06941 9.91029 9.29327 9.91029 9.56941C9.91029 9.84555 9.68643 10.0694 9.41029 10.0694H8.00671V11.3361C8.00671 11.7411 7.67838 12.0694 7.27337 12.0694C6.86836 12.0694 6.54004 11.7411 6.54004 11.3361V10.0694H3.80163V11.3361C3.80163 11.7411 3.4733 12.0694 3.06829 12.0694C2.66329 12.0694 2.33496 11.7411 2.33496 11.3361V10.0694H0.876954C0.600811 10.0694 0.376953 9.84555 0.376953 9.56941C0.376953 9.29327 0.600811 9.06941 0.876953 9.06941H2.33496V6.56941H0.876954C0.600811 6.56941 0.376953 6.34555 0.376953 6.06941C0.376953 5.79327 0.600811 5.56941 0.876953 5.56941H2.33496V3.06941H0.876954C0.600811 3.06941 0.376953 2.84555 0.376953 2.56941C0.376953 2.29327 0.600811 2.06941 0.876953 2.06941H2.33496V0.802746ZM3.80163 9.06941H6.54004V6.56941H3.80163V9.06941ZM6.54004 3.06941V5.56941H3.80163V3.06941H6.54004Z"&gt;
                      &lt;Path.Fill&gt;
                          &lt;SolidColorBrush Color="#8E8E8E"/&gt;
                      &lt;/Path.Fill&gt;
                  &lt;/Path&gt;
              &lt;/Grid&gt;
          &lt;/ControlTemplate&gt;
  
          &lt;ControlTemplate x:Key="ComboBoxTextBox"&gt;
              &lt;StackPanel Orientation="Horizontal" Width="290"  &gt;
  
                  &lt;TextBox x:Name="KMValueText" Width="40"  PreviewTextInput="UIElement_OnPreviewTextInput"  Height="{TemplateBinding TextBox.Template}"  Text="{Binding Path=KMText,Mode=TwoWay ,RelativeSource={RelativeSource FindAncestor, 
                                      AncestorType=local:TrackNameControl, 
                                      AncestorLevel=1},UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center"
                           TextAlignment="Left" GotFocus="Text_OnGotFocus" PreviewKeyDown="Mycombo_PreviewKeyDown" TabIndex="0" Style="{StaticResource TextBoxFocusStyle}" &gt;
  
                  &lt;/TextBox&gt;
                  &lt;TextBlock  Width="auto" Background="Transparent" Text="km " FontStyle="Italic"  VerticalAlignment="Center" HorizontalAlignment="Center" &gt;
                      &lt;TextBlock.Style&gt;
                          &lt;Style TargetType="TextBlock"&gt;
                              &lt;Style.Triggers&gt;
                                  &lt;DataTrigger Binding="{Binding IsFocused ,ElementName=KMValueText}" Value="False"&gt;
                                      &lt;Setter Property="Foreground" Value="Gray"&gt;&lt;/Setter&gt;
  
                                  &lt;/DataTrigger&gt;
                              &lt;/Style.Triggers&gt;
                          &lt;/Style&gt;
                      &lt;/TextBlock.Style&gt;
                  &lt;/TextBlock&gt;
  
                  &lt;TextBlock  Width="Auto"  Text="@" FontStyle="Italic"   Background ="Transparent" VerticalAlignment="Center" HorizontalAlignment="Center" &gt;
                      &lt;TextBlock.Style&gt;
                          &lt;Style TargetType="TextBlock"&gt;
                              &lt;Style.Triggers&gt;
                                  &lt;DataTrigger Binding="{Binding IsFocused ,ElementName=TrackNameText}" Value="False"&gt;
  
                                      &lt;Setter Property="Foreground" Value="Gray"&gt;&lt;/Setter&gt;
  
                                  &lt;/DataTrigger&gt;
                              &lt;/Style.Triggers&gt;
                          &lt;/Style&gt;
                      &lt;/TextBlock.Style&gt;
                  &lt;/TextBlock&gt;
  
                  &lt;Border x:Name="TrackBorder"&gt;
                      &lt;TextBox x:Name="TrackNameText" Width="190"  Height="{TemplateBinding TextBox.Template}"  Text="{Binding Path=TrackText,Mode=TwoWay,RelativeSource={RelativeSource FindAncestor, 
                                      AncestorType=local:TrackNameControl, 
                                      AncestorLevel=1}, UpdateSourceTrigger=PropertyChanged}"  
                           ToolTip="{Binding Path=TrackText}"  VerticalAlignment="Center"
                          HorizontalAlignment="Right" 
                          VerticalContentAlignment="Center" Style="{StaticResource TextBoxFocusStyle}"  IsEnabled="{Binding Path=IsStartKmMarker,RelativeSource={RelativeSource FindAncestor,AncestorType= local:TrackNameControl, AncestorLevel=1}}" GotFocus="Text_OnGotFocus" PreviewKeyDown="Mycombo_PreviewKeyDown"&gt;
                          &lt;!--&lt;TextBox.CommandBindings&gt;
                              &lt;CommandBinding Command="Delete" Executed="DeleteAll"&gt;&lt;/CommandBinding&gt;
                          &lt;/TextBox.CommandBindings&gt;
                          &lt;TextBox.InputBindings&gt;
                              &lt;KeyBinding Key="Delete" Command="Delete" &gt;&lt;/KeyBinding&gt;
                          &lt;/TextBox.InputBindings&gt;--&gt;
                      &lt;/TextBox&gt;
                  &lt;/Border&gt;
              &lt;/StackPanel&gt;
          &lt;/ControlTemplate&gt;
  
  
          &lt;Style x:Key="{x:Type ComboBox}"
         TargetType="{x:Type ComboBox}"&gt;
              &lt;Setter Property="SnapsToDevicePixels"
            Value="true" /&gt;
              &lt;Setter Property="OverridesDefaultStyle"
            Value="true" /&gt;
              &lt;Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
            Value="Auto" /&gt;
              &lt;Setter Property="ScrollViewer.VerticalScrollBarVisibility"
            Value="Auto" /&gt;
              &lt;Setter Property="ScrollViewer.CanContentScroll"
            Value="true" /&gt;
              &lt;Setter Property="MinWidth"
            Value="120" /&gt;
              &lt;Setter Property="MinHeight"
            Value="20" /&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type ComboBox}"&gt;
                          &lt;Grid&gt;
                              &lt;VisualStateManager.VisualStateGroups&gt;
                                  &lt;VisualStateGroup x:Name="CommonStates"&gt;
                                      &lt;VisualState x:Name="Normal" /&gt;
                                      &lt;VisualState x:Name="MouseOver" /&gt;
                                      &lt;VisualState x:Name="Disabled"&gt;
                                          &lt;Storyboard&gt;
                                              &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="PART_EditableTextBox"
                                                  Storyboard.TargetProperty="(TextElement.Foreground).
                        (SolidColorBrush.Color)"&gt;
                                                  &lt;EasingColorKeyFrame KeyTime="0"
                                           Value="{StaticResource DisabledForegroundColor}" /&gt;
                                              &lt;/ColorAnimationUsingKeyFrames&gt;
                                          &lt;/Storyboard&gt;
                                      &lt;/VisualState&gt;
                                  &lt;/VisualStateGroup&gt;
                                  &lt;VisualStateGroup x:Name="EditStates"&gt;
                                      &lt;VisualState x:Name="Editable"&gt;
                                          &lt;Storyboard&gt;
                                              &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                   Storyboard.TargetName="PART_EditableTextBox"&gt;
                                                  &lt;DiscreteObjectKeyFrame KeyTime="0"
                                              Value="{x:Static Visibility.Visible}" /&gt;
                                              &lt;/ObjectAnimationUsingKeyFrames&gt;
                                              &lt;ObjectAnimationUsingKeyFrames
                        Storyboard.TargetProperty="(UIElement.Visibility)"
                                                   Storyboard.TargetName="ContentSite"&gt;
                                                  &lt;DiscreteObjectKeyFrame KeyTime="0"
                                              Value="{x:Static Visibility.Hidden}" /&gt;
                                              &lt;/ObjectAnimationUsingKeyFrames&gt;
                                          &lt;/Storyboard&gt;
                                      &lt;/VisualState&gt;
                                      &lt;VisualState x:Name="Uneditable" /&gt;
                                  &lt;/VisualStateGroup&gt;
                              &lt;/VisualStateManager.VisualStateGroups&gt;
                              &lt;ToggleButton x:Name="ToggleButton"
                          Template="{StaticResource ComboBoxToggleButton}" PreviewKeyDown="Mycombo_PreviewKeyDown"
                          Grid.Column="2"
                          Focusable="false"
                          ClickMode="Press"
                          IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, 
                RelativeSource={RelativeSource TemplatedParent}}"/&gt;
                              &lt;ContentPresenter x:Name="ContentSite"
                              IsHitTestVisible="False"
                              Content="{TemplateBinding SelectionBoxItem}"
                              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                              Margin="3,3,23,3"
                              VerticalAlignment="Stretch"
                              HorizontalAlignment="Left"&gt;
                              &lt;/ContentPresenter&gt;
                              &lt;!--&lt;StackPanel Orientation="Horizontal" Width="250" x:Name="PART_EditableTextBox" &gt;
  
                                  &lt;TextBox  KeyboardNavigation.TabIndex="0" x:Name="KMValueText" Width="40"  BorderBrush="Transparent"  Text="{Binding Path=KMText,Mode=TwoWay ,RelativeSource={RelativeSource FindAncestor, 
                                      AncestorType=local:TrackNameControl, 
                                      AncestorLevel=1},UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" HorizontalAlignment="Left" VerticalContentAlignment="Center"
                           TextAlignment="Right" GotFocus="Text_OnGotFocus" PreviewKeyDown="Mycombo_PreviewKeyDown" TabIndex="0"  &gt;
  
                                  &lt;/TextBox&gt;
                                  &lt;TextBlock  Width="auto" Background="Transparent" Text="km " FontStyle="Italic"  VerticalAlignment="Center" HorizontalAlignment="Center" &gt;
                                      &lt;TextBlock.Style&gt;
                                          &lt;Style TargetType="TextBlock"&gt;
                                              &lt;Style.Triggers&gt;
                                                  &lt;DataTrigger Binding="{Binding IsFocused ,ElementName=KMValueText}" Value="False"&gt;
                                                      &lt;Setter Property="Foreground" Value="Gray"&gt;&lt;/Setter&gt;
  
                                                  &lt;/DataTrigger&gt;
                                              &lt;/Style.Triggers&gt;
                                          &lt;/Style&gt;
                                      &lt;/TextBlock.Style&gt;
                                  &lt;/TextBlock&gt;
  
                                  &lt;TextBlock  Width="Auto"  Text="@" FontStyle="Italic"   Background ="Transparent" VerticalAlignment="Center" HorizontalAlignment="Center" &gt;
                                      &lt;TextBlock.Style&gt;
                                          &lt;Style TargetType="TextBlock"&gt;
                                              &lt;Style.Triggers&gt;
                                                  &lt;DataTrigger Binding="{Binding IsFocused ,ElementName=TrackNameText}" Value="False"&gt;
  
                                                      &lt;Setter Property="Foreground" Value="Gray"&gt;&lt;/Setter&gt;
  
                                                  &lt;/DataTrigger&gt;
                                              &lt;/Style.Triggers&gt;
                                          &lt;/Style&gt;
                                      &lt;/TextBlock.Style&gt;
                                  &lt;/TextBlock&gt;
  
                                  &lt;Border x:Name="TrackBorder"&gt;
                                      &lt;TextBox x:Name="TrackNameText" KeyboardNavigation.TabIndex="1" Width="130"  BorderBrush="Transparent" Text="{Binding Path=TrackText,Mode=TwoWay,RelativeSource={RelativeSource FindAncestor, 
                                      AncestorType=local:TrackNameControl, 
                                      AncestorLevel=1}, UpdateSourceTrigger=PropertyChanged}"  
                           ToolTip="{Binding Path=TrackText}"  VerticalAlignment="Center"
                          HorizontalAlignment="Right" 
                          VerticalContentAlignment="Center" TabIndex="1"  IsEnabled="{Binding Path=IsStartKmMarker,RelativeSource={RelativeSource FindAncestor,AncestorType= local:TrackNameControl, AncestorLevel=1}}" GotFocus="Text_OnGotFocus" PreviewKeyDown="Mycombo_PreviewKeyDown"&gt;
  
                                      &lt;/TextBox&gt;
                                  &lt;/Border&gt;
                              &lt;/StackPanel&gt;--&gt;
                              &lt;TextBox x:Name="PART_EditableTextBox"
                     Style="{x:Null}"
                     Template="{StaticResource ComboBoxTextBox}" 
                     HorizontalAlignment="Left"
                     VerticalAlignment="Bottom"
                     Margin="3,3,23,3"
                     Focusable="True"
                     Background="Transparent"
                     Visibility="Hidden"
                     IsReadOnly="{TemplateBinding IsReadOnly}" IsTabStop="True" /&gt;
  
                              &lt;Popup x:Name="_popup" KeyboardNavigation.TabIndex="3"
                   Placement="Bottom"
                   IsOpen="{TemplateBinding IsDropDownOpen}"
                   AllowsTransparency="True"
                   Focusable="False"
                   PopupAnimation="Slide"&gt;
                                  &lt;Grid x:Name="DropDown"
                    SnapsToDevicePixels="True"
                    MinWidth="{TemplateBinding ActualWidth}"
                    MaxHeight="{TemplateBinding MaxDropDownHeight}"&gt;
                                      &lt;Border x:Name="DropDownBorder"
                        BorderThickness="1"&gt;
                                          &lt;Border.BorderBrush&gt;
                                              &lt;SolidColorBrush Color="{DynamicResource BorderMediumColor}" /&gt;
                                          &lt;/Border.BorderBrush&gt;
                                          &lt;Border.Background&gt;
                                              &lt;SolidColorBrush Color="{DynamicResource ControlLightColor}" /&gt;
                                          &lt;/Border.Background&gt;
                                      &lt;/Border&gt;
                                      &lt;ScrollViewer Margin="4,6,4,6"
                              SnapsToDevicePixels="True"&gt;
                                          &lt;StackPanel IsItemsHost="True"
                              KeyboardNavigation.DirectionalNavigation="Contained" /&gt;
                                      &lt;/ScrollViewer&gt;
                                  &lt;/Grid&gt;
                              &lt;/Popup&gt;
                          &lt;/Grid&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="HasItems"
                     Value="false"&gt;
                                  &lt;Setter TargetName="DropDownBorder"
                      Property="MinHeight"
                      Value="95" /&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsGrouping"
                     Value="true"&gt;
                                  &lt;Setter Property="ScrollViewer.CanContentScroll"
                      Value="false" /&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger SourceName="_popup"
                     Property="AllowsTransparency"
                     Value="False"&gt;
                                  &lt;Setter TargetName="DropDownBorder"
                      Property="CornerRadius"
                      Value="4" /&gt;
                                  &lt;Setter TargetName="DropDownBorder"
                      Property="Margin"
                      Value="0,2,0,0" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  
          &lt;Style x:Key="{x:Type ComboBoxItem}"
         TargetType="{x:Type ComboBoxItem}"&gt;
              &lt;Setter Property="SnapsToDevicePixels"
            Value="true" /&gt;
              &lt;Setter Property="OverridesDefaultStyle"
            Value="true" /&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type ComboBoxItem}"&gt;
  
                          &lt;Border x:Name="Border"
                  Padding="2"
                  SnapsToDevicePixels="true"
                  Background="Transparent"&gt;
                              &lt;VisualStateManager.VisualStateGroups&gt;
                                  &lt;VisualStateGroup x:Name="SelectionStates"&gt;
                                      &lt;VisualState x:Name="Unselected" /&gt;
                                      &lt;VisualState x:Name="Selected"&gt;
                                          &lt;Storyboard&gt;
                                              &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                  Storyboard.TargetProperty="(Panel.Background).
                      (SolidColorBrush.Color)"&gt;
                                                  &lt;EasingColorKeyFrame KeyTime="0"
                                           Value="{StaticResource ControlPressedColor}" /&gt;
                                              &lt;/ColorAnimationUsingKeyFrames&gt;
                                          &lt;/Storyboard&gt;
                                      &lt;/VisualState&gt;
                                      &lt;VisualState x:Name="SelectedUnfocused"&gt;
                                          &lt;Storyboard&gt;
                                              &lt;ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                  Storyboard.TargetProperty="(Panel.Background).
                      (SolidColorBrush.Color)"&gt;
                                                  &lt;EasingColorKeyFrame KeyTime="0"
                                           Value="{StaticResource ControlPressedColor}" /&gt;
                                              &lt;/ColorAnimationUsingKeyFrames&gt;
                                          &lt;/Storyboard&gt;
                                      &lt;/VisualState&gt;
                                  &lt;/VisualStateGroup&gt;
                              &lt;/VisualStateManager.VisualStateGroups&gt;
                              &lt;TextBlock Text="{Binding Item3}" /&gt;
                          &lt;/Border&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  
  
      &lt;/UserControl.Resources&gt;
      &lt;Grid&gt;
  
  
              &lt;ComboBox x:Name="TrackComboBoxEx" IsEditable="True"
                    Width="230"
                    Height="25"
                    IsTextSearchEnabled="True"
                    ItemsSource="{Binding Path=ItemsSource,RelativeSource={RelativeSource FindAncestor,AncestorType=local:TrackNameControl,AncestorLevel=1}}"  SelectedItem="{Binding Path=SelectedItem , RelativeSource={RelativeSource FindAncestor,AncestorType=local:TrackNameControl,AncestorLevel=1}}" 
                        SelectionChanged="Mycombo_SelectionChanged" PreviewKeyDown="Mycombo_PreviewKeyDown"  PreviewMouseDown="TrackComboBoxEx_OnPreviewMouseDown" &gt;
  
              &lt;/ComboBox&gt;
  
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>`</p>