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

TextEdit.SelectedText Property

Gets or sets the selected text.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.1.dll


public string SelectedText { get; set; }

Property Value

Type Description

A string value representing the selected text.


Read the SelectedText property value to obtain the currently selected text. If no text is presently selected , the property returns an empty string. Assign a string to the SelectedText property to replace the currently selected text with the string specified. If no text is selected presently, assigning a value will insert the specified text to the current caret position. Note that changing the SelectedText property value removes the selection.

To select text via code, use the TextEdit.SelectionStart and TextEdit.SelectionLength properties.

See Also