TextEdit.SelectionStart

From Xojo Documentation

Property (As Integer )
aTextEdit.SelectionStart = newIntegerValue
or
IntegerValue = aTextEdit.SelectionStart

New in 2019r2

Supported for all project types and targets.

The position of the insertion point.

Notes

A value of zero means that the insertion point is before the first character. Use SelectionStart to set the position of the insertion point in the text. Use SelectionStart in conjunction with SelectionLength to select a portion of the text in the control, beginning with SelectionStart and extending for SelectionLength characters.

On Windows, selecting text via code does not display the text as selected unless the control has the focus. If you want this behavior, call SetFocus before setting the selection.

Example

This example selects the first 10 characters of TextArea1.

TextArea1.SelectionStart = 0
TextArea1.SelectionLength = 10