TextEdit.SelText

From Xojo Documentation

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

New in 2009r5

Supported for all project types and targets.

The currently highlighted text.

Example

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

TextArea1.SelStart = 0
TextArea1.SelLength = 10

TextField1.Text = TextArea1.SelText