title: How to customize textbox and combo box border WPF
body: <p>Before I post my code let me post image where you can easily notice what's acctually happening:</p>
  
  <p><a href="https://i.stack.imgur.com/m8Jgx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m8Jgx.png" alt="enter image description here"></a></p>
  
  <p>And as you can see on text boxes, border thickness is not same on every side.
  In case of textbox it is much more brighter on the right for example.
  Also on combobox there is something like shadow on top and on left side..</p>
  
  <p>How could I fix this, I simply want 1px blue border around my controls..</p>
  
  <p>And here is my code:</p>
  
  <pre><code>&lt;ComboBox Name="cmbComboBoxOne"  Height="40" BorderThickness="1"   VerticalAlignment="Center" BorderBrush="#0091EA" &gt;&lt;/ComboBox&gt;
  &lt;TextBox Name="txtTextBoxOne"    TextWrapping="Wrap"  Text="TextBox" BorderThickness="1"        BorderBrush="#0091EA" /&gt;
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I applied Edit Template Copy, I set border thickness to 1 and colour to purple, and it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/VriQZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VriQZ.png" alt="enter image description here"></a></p>
  
  <p>So guys, again it is not good with thickness:1 px, for example with thickness:2px its awesome, all sides are equal but 2px is too much for me..</p>
  
  <p>Here is my code after I edited template:</p>
  
  <pre><code>&lt;TextBox x:Name="txtName" Grid.Column="1" SnapsToDevicePixels="True" UseLayoutRounding="True" Grid.Row="0" Margin="5,0,10,0" TextWrapping="Wrap" Text="TextBox" Height="40"  VerticalAlignment="Center" Style="{DynamicResource TextBoxStyle1}"  &gt;
              &lt;TextBox.Resources&gt;
                  &lt;Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}"&gt;
                      &lt;Setter Property="BorderBrush" Value="Purple"/&gt;
                      &lt;Setter Property="BorderThickness" Value="1"/&gt;
                      &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/&gt;
                      &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/&gt;
                      &lt;Setter Property="Padding" Value="1"/&gt;
                      &lt;Setter Property="KeyboardNavigation.TabNavigation" Value="None"/&gt;
                      &lt;Setter Property="HorizontalContentAlignment" Value="Left"/&gt;
                      &lt;Setter Property="FocusVisualStyle" Value="{x:Null}"/&gt;
                      &lt;Setter Property="AllowDrop" Value="true"/&gt;
                      &lt;Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/&gt;
                      &lt;Setter Property="Stylus.IsFlicksEnabled" Value="False"/&gt;
                      &lt;Setter Property="Template"&gt;
                          &lt;Setter.Value&gt;
                              &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                                  &lt;Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" BorderStyle="Sunken" Background="{TemplateBinding Background}"&gt;
                                      &lt;ScrollViewer x:Name="PART_ContentHost"/&gt;
                                  &lt;/Microsoft_Windows_Themes:ClassicBorderDecorator&gt;
                                  &lt;ControlTemplate.Triggers&gt;
                                      &lt;Trigger Property="IsEnabled" Value="false"&gt;
                                          &lt;Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/&gt;
                                          &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/&gt;
                                      &lt;/Trigger&gt;
                                  &lt;/ControlTemplate.Triggers&gt;
                              &lt;/ControlTemplate&gt;
                          &lt;/Setter.Value&gt;
                      &lt;/Setter&gt;
                  &lt;/Style&gt;
              &lt;/TextBox.Resources&gt;
          &lt;/TextBox&gt;
  </code></pre>
  
  <p>as you can see guys   </p>
  
  <pre><code>&lt;Setter Property="BorderBrush" Value="Purple"/&gt;
                      &lt;Setter Property="BorderThickness" Value="1"/&gt; 
  </code></pre>
  
  <p>are set, but result is somehow same :/</p>