SetFocus Method (Control)

Class

Control.

Action

Gives focus to the control.

Syntax

control.SetFocus ( )

Notes

SetFocus gives the input focus to the specified control (that is, makes it the control to which the GUI directs keystrokes).

It is not necessary to call SetFocus prior to using any of the functions that operate on controls. Call it in cases where you plan to use TypeKeys to pass keystrokes to a pop-up window, and you need to display the window first.

Example

TextEditor.Document.SetFocus ()