TextField.SetFocus

From Xojo Documentation

Method

TextField.SetFocus()

Supported for all project types and targets.

Gives the TextField the focus, sending all keydown events to the TextField and moving the cursor there.