RichTextBox.CaretPosition Property

 

Gets or sets the position of the input caret.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

member CaretPosition : TextPointer with get, set

Property Value

Type: System.Windows.Documents.TextPointer

A TextPointer object specifying the position of the input caret.

By default, the caret is at the first insertion position at the beginning of the content hosted by the RichTextBox. See TextPointer for more information on text position terminology like "insertion position".

Exception Condition
ArgumentNullException

An attempt is made to set this property to null.

ArgumentException

An attempt is made to set this property to a TextPointer that references a position outside of the current document.

The following example illustrates the use of this property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: