title: TextBox border radius style in WPF
body: <p>I checked similar questions but I couldn't figure out the underlying logic.</p>
  
  <p>I am trying to add <code>CornerRadius</code> to a <code>TextBox</code> in a <code>WPF</code> project.
  Here's what I tried so far:</p>
  
  <p>In <code>App.xaml</code> I created a <code>Style</code> that I intend to reuse:</p>
  
  <pre><code>&lt;Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}"&gt;
     &lt;Setter Property="Height" Value="27"/&gt;
     &lt;Setter Property="Padding" Value="5.5"/&gt;
  
     &lt;Setter Property="BorderThickness" Value="0"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Adding: <code>&lt;Setter Property="Border.CornerRadius" Value="5"/&gt;</code> didn't work. However, the following worked, but with side effects (all borders where rounded):</p>
  
  <pre><code>&lt;Style TargetType="{x:Type Border}"&gt;
     &lt;Setter Property="CornerRadius" Value="5"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>I want to keep the styles separate and basically use them like this: </p>
  
  <pre><code>&lt;TextBox x:Name="ExampleTb" Style="{StaticResource TextBoxStyle}"/&gt;
  </code></pre>
  
  <p>Can you please help me/ point me in the right direction?</p>