WPF TextBox Caret disappears

I am developing a WPF application with TextBoxcomponents.

I have a problem with text field carriage. It seems that depending on the location of the TextBoxcarriage itself, it disappears in certain places

Carriage Display:

Carriage display

The carriage disappears:

Caret disappears

Refund Caret:

enter image description here

The style is TextBoxvery simple:

<Style TargetType="{x:Type TextBox}" x:Key="FormTextBox">
    <Setter Property="Width" Value="464"/>
    <Setter Property="Height" Value="74"/>
    <Setter Property="HorizontalAlignment" Value="Left"/>
    <Setter Property="FontFamily" Value="Microsoft Sans Serif"/>
    <Setter Property="FontSize" Value="43.2"/>
    <Setter Property="MaxLength" Value="50"/>
</Style>

I even tried to set the font to Courier New, which is a monospaced font, the same.

+4
source share
1 answer

The problem seems to be common ( 1 , 2 ) with scale conversion, which is applied by the behavior you mentioned in the comments.

mainElement.LayoutTransform = scaleTransform;

MSDN

.

, , ViewBox; .

+3

Source: https://habr.com/ru/post/1664819/


All Articles