0

When I change the resolution of my WPF the caret simply starts to disappear.

This occurs at lower resolutions like 1024x768.

Example:

Caret showing:

enter image description here

Caret disappears:

enter image description here

Caret returns:

enter image description here

<Viewbox>
  <Grid>
    <TextBox Style="{StaticResource MaterialDesignFilledTextFieldTextBox}" Margin="1590,795,65,200" />
  </Grid>
</Viewbox>

Is there any way today how to fix this?

Jackdaw
  • 7,626
  • 5
  • 15
  • 33
robert
  • 19
  • 5
  • Why are such large values are used for the `Margin`? The problem may be related to the resolution. Therefore, look at the following post: [Resolution independent or monitor size independent WPF apps](https://stackoverflow.com/q/4897849/6630084). – Jackdaw Nov 24 '20 at 02:38
  • Margin has this value because I'm using 2k resolution for testing. the ViewBox works well for what I want, the only problem is Caret – robert Nov 24 '20 at 02:57
  • Because of this 'TextBox' uses the **MaterialDesign** style try to remove `Style="{StaticResource MaterialDesignFilledTextFieldTextBox}"` and check if it will work without it. – Jackdaw Nov 24 '20 at 09:43
  • even after removing material design problem still remains – robert Nov 24 '20 at 12:52
  • So, this is not related to the MaterialDesign. More like focus issue, but don't clear how it related to the screen resolution. You can check this with suggestion from **[this post](https://stackoverflow.com/q/14200909/6630084)** - use timer to set focus on the textbox, to check it is related to focus or not. – Jackdaw Nov 24 '20 at 13:05
  • it doesn't seem to be a focus problem, the TextBox is focused correctly, even if the caret is not shown I can type normally, I found something that talks about the subject https://stackoverflow.com/a/40040881/12865533 I thought that after so long this problem had been fixed in newer versions – robert Nov 24 '20 at 13:44

0 Answers0