OnGotFocus Event

Occurs when an object gets the focus.

Syntax

Object.OnGotFocus()

The OnGotFocus event syntax has the following parts:

 

Name

Type

Description

Object

An object

A control or the AForm object

Comments

This event applies only to controls and classes which can accept keyboard input.

This event occurs when an object receives the focus, either by user action, such as tabbing to or clicking the object, or by changing the focus in code using the SetFocus method. A form receives the focus only when all visible controls are disabled.

Typically, you use an OnGotFocus event procedure to specify the actions that occur when a control or form first receives the focus. For example, by attaching an OnGotFocus event procedure to each control on a form, you can guide the user by displaying brief instructions or status bar messages. You can also provide visual cues by enabling, disabling, or showing other controls that depend on the control that has the focus.

Note: An object can receive the focus only if its Enabled and Visible properties are set to True. To customize the keyboard interface in ATEasy for moving the focus, set the tab order or specify access keys for controls on a form.

Example

tbInput.OnGotFocus()

{

lbInputList.Caption="Select input type:"

}

Applies to

 

AButton

AListBox

ASlider

ACheckBox

ALog

ASwitch

AComboBox

ARadioButton

ATextBox

AForm

AScrollBar

 

See Also

Enabled, OnLostFocus, SetFocus