0

I'm trying to remove caret blinking from a textbox after the input is done. I've tried focusing another control programmatically and setting IsReadOnlyCaretVisible=false and IsReadOnly on mouseleave event but nothing helps. What should I do? The caret still remains there whatever I do...

OneMoreVladimir
  • 1,653
  • 3
  • 21
  • 32

1 Answers1

2

That's very strange. The caret should go away when the focus changes, eg when you click out of the textbox. You can't use the old fashioned "HideCaret" WINAPI function, since it's not a standard Windows control - it's WPF.

This question addresses the OPPOSITE of your problem, since your problem isn't supposed to even happen, and the solution was a very simple line of code. Perhaps if you flip the logic around, or find out if your code is already doing this and disable that part - you can get the result you're looking for: WPF Textbox persist visible caret

Also, if you're using a recent version of WPF, you can probably reassign the brush that the caret uses.

Community
  • 1
  • 1
djdanlib
  • 21,449
  • 1
  • 20
  • 29
  • Ive created a usercontrol with a textbox and I'm adding those controls to Canvas. When I edit the text and then click on canvas or wherever the caret still remains blinking in the textbox... =( – OneMoreVladimir Oct 18 '11 at 18:21