.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

Document.CaretPosition Property

Gets or sets the position of the caret within the document.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

DocumentPosition CaretPosition { get; set; }

Property Value

Type Description
DocumentPosition

A DocumentPosition object, representing the current caret position.

Remarks

Use this property to insert text at the current cursor position or to access the paragraph where the cursor is located (the ReadOnlyParagraphCollection.Get method).

NOTE

When working with headers/footers, use the DocumentPosition.BeginUpdateDocument - DocumentPosition.EndUpdateDocument pair to get the correct position. Otherwise an InvalidOperationException is thrown.

See Also