SetFocus Method

Moves the focus to the object.

Syntax

Object.SetFocus()

The SetFocus method syntax has the following parts:

 

Name

Type

Description

Object

A control

A control object

Comments

This method works only on controls which are visible and enabled. When a control has focus, it will accept keyboard commands.

Example

The following example will move the focus to the ACheckBox on the screen:

chk1.SetFocus()

Applies to

Applies to all controls (except the AImage) and the AForm.

See Also

Enabled, OnGotFocus, OnLostFocus, Visible