A newer version of this page is available. Switch to the current version.

TextEdit.SelectionStart Property

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.1.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.

See Also