TextEdit.ScrollToCaret() Method
Scrolls the editor’s content to the current caret position.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
Remarks
This method enables you to scroll the contents of the control until the caret is within the visible region of the control. If the caret is positioned below the visible region of the control, the ScrollToCaret method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. Note that the ScrollToCaret method is not used for text box controls (controls displaying a single text line). The contents of such controls is always scrolled to a position that ensures that the caret is visible. If you simply need to scroll the content of such controls horizontally, use the TextEdit.SelectionStart property. This will move the caret to the specified position and make the caret visible.
Note that this method is not in effect if the control does not have focus or if the caret is already positioned in the visible region of the control.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ScrollToCaret() method.
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.