Official Content

Directs the user's input to the specified control.

Syntax

Control.Setfocus()

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

Scope

Objects: Transaction, Web PanelWork Panel,Panel,Work With pattern and Work With object
Controls: Button, Check Boxes, Combo Boxes, Dynamic Combo Box, Dynamic List Box, Edits, Forms, Grids, List Boxes, Radio Buttons
Generators: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

Samples

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

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

Note: When this method is used on elements in a Grid, it is supported for the first row only.

See Also

Focus control property
IsValid Event for Web Applications


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant