Hide caret in WPF TextBox Hide caret in WPF TextBox wpf wpf

Hide caret in WPF TextBox


Caret is the current insert position in a text editor. Cursor is the shape of the mouse cursor.

There is no way to disable the caret in a read-write TextBox. Instead, change the CaretBrush to be transparent.

TextBox txt = ...;// Hide the caret.txt.CaretBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));// Show the caret.txt.CaretBrush = null;  // use default Brush


You can colour the cursor the same colour as the background or Transparent using the TextBox.CaretBrush property.