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

Declaration

[Browsable(false)]
public string SelectedText { get; set; }

Property Value

Type Description
String

A string value representing the selected text.

Remarks

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedText 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