TextEdit.ScrollToCaret() Method

Scrolls the editor's content to the current caret position.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

public void ScrollToCaret()
Public Sub ScrollToCaret

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.

See Also