SETFOCUS
8.0.4, PLBCMP GUI Only
The SETFOCUS instruction changes the current focus to another currently active object. The SETFOCUS instruction may be used for objects in the main window and objects in a dialog. It uses one of the following formats:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A previously defined, created, and activated object or pointer to an object that is to receive focus.
item
Optional. A Numeric Variable, decimal constant, or Expression that indicates the item within the object that receives focus.
win
Required. A previously created WINDOW object.
relative
Required. A Numeric Variable, decimal constant, or Expression that indicates the item that receives focus.
dialog
Required. A previously defined and created DIALOG object or pointer to a DIALOG object containing an object that receives focus.
dialog-no
Required. A Numeric Variable, numeric literal, decimal constant, or Expression that indicates the item within the dialog that receives focus.
Flags Affected: NONE
Note the following:
The optional parameter {item} may be a decimal constant or a numeric variable. It is ignored for all objects except for the following objects: CHECKGRP and RADIOGRP. For these two objects the value of {item} indicates which item in the group is to receive focus.
If the specified {relative} value is '-1', the focus is changed to the next object in the TABID sequence relative to the object that currently has the focus on the {window} object.
If the specified {relative} value is '-4', the focus is changed to the prior object in the TABID sequence relative to the object that currently has the focus on the {window} object.
If {object} is a DIALOG, the second form of the instruction is used. The {dialog-no} indicates the object in the DIALOG to which the focus is set. If the value of {dialog-no} is invalid, no action is taken.
If object selected is not on the active window, the window is activated and brought to the front.
The SETFOCUS instruction supports NETCONTROL objects.
See Also: Example Code, GETFOCUS, Object Instructions
![]() |