SetFocus – PB Docs 2018

SetFocus

PowerScript function

Description

Sets the focus on the specified object or control.

Applies to

Any object

Syntax

Argument

Description

objectname

The name of the object or control in which you want to set
the focus

Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. If objectname is
null, SetFocus returns null.

Usage

If objectname is a ListBox, SetFocus displays the focus rectangle
around the first item. If objectname is a DropDownListBox,
SetFocus highlights the edit box. To select an item in a ListBox or
DropDownListBox, use SelectItem.

Drawing objects cannot have focus. Therefore, you cannot use
SetFocus to set focus to in a Line, Oval, Rectangle, or
RoundRectangle.

Examples

This statement in the script for the Open event in a window moves
the focus to the first item in lb_Actions:

See also

SetItem

SetState

SetTop


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x