SetFocus Method

Official Content
This documentation is valid for:

Directs the user's input to the specified control.

Syntax

Control.Setfocus()

Where:
Control
    Is the name of a control inserted in the form.

Example

Event 'GetClient'
    GetCli.Call(CliCode, CliName)
    SupCod.Setfocus()
EndEvent

Suppose we have a button in a form that calls a procedure to obtain the client’s name given its code and we want to direct the input (locate the cursor) to attribute SupCode after the call is performed. This is done by using setfocus method with attribute SupCode within the event associated to the button as shown in the example.

Scope

Objects: Transactions, Web PanelsWork Panels,Panel object,Work With object
Controls: Buttons, Check Boxes, Combo Boxes, Dynamic Combo Boxes, Dynamic List Boxes, Edits, Forms, Grids, List Boxes, Radio Buttons
Languages: .Net, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)
Interfaces: Web, Win

See Also

Focus Control Property
IsValid Event for Web Applications