How to display caret in custom WPF text box
问题 I have designed my own text box in WPF by creating my own custom control template. However, I cannot seem to get the caret to show up. Here is my TextBox style: <Style TargetType="{x:Type TextBox}"> <Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="AllowDrop" Value="True"/> <Setter Property=