Window.SetFocus
From Xojo Documentation
Method
Removes the focus from the control that currently has the focus, leaving no control with the focus.
Notes
On Windows, the app will continue to receive KeyDown events which it can accept by returning True from the KeyDown event.
On macOS, this method does not do anything. Use the ClearFocus method to remove focus from the control on the window that has the focus.
On Linux, this method works the same as ClearFocus.
Use the SetFocus method of the RectControl class to set the focus to a particular control in the window.