Gets or sets the Brush that describes the text insertion cursor for a PasswordBox or TextBox.

<object CaretBrush="colorString"  .../>
value = object.CaretBrush
object.CaretBrush = value




The Color for a SolidColorBrush expressed as an attribute string. This can be a named color, an RGB value, or an ScRGB value. RGB or ScRGB may also specify alpha information. For more information, see the "colorString Grammar" section in Color.


Within opening and closing property elements for object.CaretBrush, exactly one object element for an object that derives from Brush. The object element can be one of the following: LinearGradientBrush, RadialGradientBrush, ImageBrush, SolidColorBrush, or VideoBrush.

Type: Brush

The brush that is used to fill the text insertion cursor.

This property is read/write. The default value is null.

For purposes of rendering, the null default value for CaretBrush evaluates as a black brush.

You typically use a solid color for a CaretBrush, instead of a more visually complex brush.

The purpose of a separate CaretBrush property is so that you can change the text insertion cursor color. If you have set the Background to a dark color, the default text insertion cursor may be hard for users to see.

Silverlight version 3


Community Additions