How to set the focus in a form
Prev | Chapter 5. Tips and tricks | Next

## How to set the focus in a form

Put the following code into the on_click action of a button:

Example 5.11. Setting the taborder

    hk_this.datasource().setmode_insertrow()
    hk_thisform.goto_taborder_first()

When you push the button the datasource will allow you to insert a new row and move the focus from the button to the first field. Other possible functions are:

> set_focus(widget)

>   will set the focus to 'widget'

>   Example 5.12. Setting the taborder for a specific field

>       hk_thisform.set_focus(hk_thisform.get_pyvisible(2))

> set_taborder( taborder[,registerchange [, forcesetting]])

>   sets the tab order (the focus order) of the widgets. 'taborder' is a list of the presentation numbers of the widgets, which should get the focus

> goto_taborder_next()

>   will move the the focus to the next widget (see ??? )

> goto_taborder_previous()

>   will move the the focus to the previous widget (see ??? )

> goto_taborder_first()

>   will move the the focus to the first widget (see ??? )

> goto_taborder_last()

>   will move the the focus to the last widget (see ??? )

Prev | Up | Next
How to print rows in alternating colours | Home | How to react on pressed keys