Skip to main content
A newer version of this page is available. .

TextEdit.SelectionStart Property

Gets or sets the starting point of text selected in the text box.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[Browsable(false)]
public int SelectionStart { get; set; }

Property Value

Type Description
Int32

An integer value specifying the starting point of text selected in the text box.

Remarks

If no text is selected within the editor, this property indicates the insertion point for new text (the caret position). If you set this property to a location beyond the length of the text in the control, selection start position will be placed after the last character. If the remaining text in the control after the position indicated by the SelectionStart property is less than the value of the TextEdit.SelectionLength property, the value of the TextEdit.SelectionLength property is automatically decreased. The value of the SelectionStart property never causes an increase in the TextEdit.SelectionLength property.

You can programmatically move the caret within the text box by setting SelectionStart to the position within the text box where you want the caret to move to and set the TextEdit.SelectionLength property to zero.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectionStart property.

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.

See Also