TextEdit.SelectedText

From Xojo Documentation

Property (As String )
aTextEdit.SelectedText = newStringValue
or
StringValue = aTextEdit.SelectedText

New in 2019r2

Supported for all project types and targets.

The currently selected text.

Example

This example places the selected text from a TextArea into a TextField.

TextArea1.SelectionStart = 0
TextArea1.SelectonLength = 10

TextField1.Value = TextArea1.SelectedText