Search code examples
wpftextboxfocuscaret

TextBox text cursor is still visible after losing focus


I have a textbox on a Grid. I populate this textbox with some text and when losing focus (I click outside this component containing the Grid with the textbox), I still have the text cursor visible. Its not blinking but is visible. Isn't WPF supposed to take care of this?

The marker is not blinking in this state, its just showing a |.

I have no idea how to approach this, any suggestions?


Solution

  • Solved with adding this to the focus event for the textbox.

    FocusManager.SetIsFocusScope(this, true);