title: How can I get an inset drop shadow using WPF XAML
body: <p>I've tried following a few different answers here on SO on achieving a drop shadow effect on my <code>Textbox</code>, here is the code I have so far:</p>
  
  <pre><code>&lt;Style x:Key="TextBoxRoundedInset" TargetType="{x:Type TextBox}"&gt;
              &lt;Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/&gt;
              &lt;Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/&gt;
              &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/&gt;
              &lt;Setter Property="BorderThickness" 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="TextAlignment" Value="Center"/&gt;
              &lt;Setter Property="HorizontalContentAlignment" Value="Center"/&gt;
              &lt;Setter Property="VerticalContentAlignment" Value="Center"/&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type TextBox}"&gt;
                          &lt;Border x:Name="border" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True" ClipToBounds="True"&gt;
                              &lt;Border Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="-2"&gt;
                              &lt;ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/&gt;
                              &lt;Border.Effect&gt;
                                      &lt;DropShadowEffect ShadowDepth="0" BlurRadius="10"/&gt;
                                  &lt;/Border.Effect&gt;
                              &lt;/Border&gt;
                          &lt;/Border&gt;
  
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsEnabled" Value="false"&gt;
                                  &lt;Setter Property="Opacity" TargetName="border" Value="0.56"/&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsMouseOver" Value="true"&gt;
                                  &lt;Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsKeyboardFocused" Value="true"&gt;
                                  &lt;Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
              &lt;Style.Triggers&gt;
                  &lt;MultiTrigger&gt;
                      &lt;MultiTrigger.Conditions&gt;
                          &lt;Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/&gt;
                          &lt;Condition Property="IsSelectionActive" Value="false"/&gt;
                      &lt;/MultiTrigger.Conditions&gt;
                      &lt;Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/&gt;
                  &lt;/MultiTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>Then to display with the styling I have</p>
  
  <pre><code>&lt;TextBox x:Name="textBox" Background="#263238" Height="40" Margin="0,0,0,50" TextWrapping="Wrap" Width="221" VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="0" Style="{DynamicResource TextBoxRoundedInset}" FontSize="25"/&gt;
  </code></pre>
  
  <p>But I end up with a result that looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/uF3Os.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uF3Os.png" alt="Pic"></a></p>
  
  <p>I don't want the text to have a glow to it, instead I basically want the text field to look like its dropped into the background any information on how to correct this would be great thanks</p>