/
setFocus
setFocus
Description
Sets the input focus on the user control that is specified by userControlID
. Only one control (either user or native) can have the input focus at any one time.
The control with the input focus is the one that receives keyboard and mouse input. You can set the focus to a user control so that it will be the recipient of keyboard and mouse messages.
The input focus is lost when the user clicks outside of the control, or tabs outside of it.
Functional area
User Window
Command syntax
Syntax
setFocus userControlID |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
userControlID | int | yes | ID of user control to set focus on |
Flags
None
Return value
void
Examples
// Set the focus to one of our controls. int $windowId; int $controlId; // First create a User Window to place the control on $windowId = `createWindow "MyWindow"`; // Create a Text Box Control in the window. $controlId = `createTextBox $windowId`; // Set the focus to the control setFocus $controlId;
Additional information
Related commands
, multiple selections available,