DocumentPosition Class
A position within a document.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
Related API Members
The following members return DocumentPosition objects:
Library | Related API Members |
---|---|
WinForms Controls | RichEditControl.GetPositionFromPoint(PointF) |
WPF Controls | RichEditControl.GetPositionFromPoint(PointF) |
Office File API | Capture.Position |
CustomMark.Position | |
Document.CaretPosition | |
DocumentRange.End | |
DocumentRange.Start | |
SubDocument.CreatePosition(Int32) |
Remarks
To get the current positon of a text cursor (caret) in a document, use the Document.CaretPosition property. To convert mouse coordinates to a document position, the RichEditControl.GetPositionFromPoint method is provided.
A DocumentRange object is defined by its DocumentRange.Start and DocumentRange.End positions.
Use the SubDocument.CreatePosition method to obtain an arbitrary position in a document. To convert a DocumentPosition object to an integer position, call the DocumentPosition.ToInt method.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentPosition class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.