Why is the cursor hidden behind a textbox?

<Style TargetType="TextBox"> <Setter Property="Foreground" Value="WhiteSmoke"/> <Setter Property="Background" Value="Gray"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> <Border Background="Black"/> <Border Background="{TemplateBinding Background}"/> <ScrollViewer x:Name="PART_ContentHost"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> 

    1 answer 1

    Why is the cursor hidden behind a textbox?

    because it is the same color as the background. Change the color of the cursor and it will be visible:

     <TextBox CaretBrush="White" ...