Link Search Menu Expand Document

FocusObject.MoveFocus Method

Explanation The focus is changed according to the focus movement order.

Focus may not move correctly in the following cases.
-When keyboard focus is set other than the object that called the MoveFocus method.
-In the case of an object that is originally in a state where it does not receive focus, such as an option button that has not been selected.
-For objects in inactive windows hidden in dialogs.

Normally, it is used in the FocusOperation event of the object whose AutoTabFocus property is set to $ FALSE. The MoveFocus method is executed only when the OnFocusOperation event handler is used to check the input value for errors and the focus movement is permitted.
Added since Ver.4.1.0, Mobile Ver.2.0.0
Constant Value Description
$ NEXTFOCUS 1 Next object
The focus moves in the same order as the Tab key.
$ PREVFOCUS 2 Previous object
The focus moves in the same order as the Shift + Tab keys.
Call format obj.MoveFocus( [ direction ] )
Return value None
Arguments integer direction Direction to move
Specify the following values. If omitted, it will be $ NEXTFOCUS
Exception None
Example of use
if (MessageBox("確認してください", "確認", $OkCancel) == OkSelected) {
    TextBox1.MoveFocus($PREVFOCUS);
}
    
Related item