OnGotFocus Property

Sets or gets the name of the macro or script to be run when the GotFocus event occurs.

object.OnGotFocus = [string]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the script or macro to run when the event is triggered.

Client support

   Newlook Smartclient only.

Use

The GotFocus event occurs when an object receives the focus. A form receives the focus only when all visible controls are disabled or the host screen is received with the focus on a disabled or hidden control.

Typically, you use an OnGotFocus macro or script to specify the actions that occur when a control or form first receives the focus. For example, by attaching an OnGotFocus macro 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.

An object can receive the focus only if its Enabled and Visible properties are set to True.

To customize the keyboard interface for changing the focus, set the tab order or specify access keys for controls on a form.

DATAGRID CONTROL:

In relation to the DataGrid control, the GotFocus event is triggered once when the DataGrid object first receives the focus. Use the BeginEdit event to specify actions to run when individual cells receive the focus.

FORM OBJECT:

A form receives the focus only when all visible controls are disabled or the host screen is received with the focus on a disabled or hidden control.

See Also

OnLostFocus property | ActiveControl property | Enabled property | Visible property

Applies To

Check box control

Combo box control

Command button control

Data control

DataGrid control

Date combo box control

Form object

Label control

ListBox control

ListView control

Menu button control

NumericCombo control

Option button control

PictureBox control

ProgressBar control

ScrollBar control (control deprecated in version 10.5)

SmartNav control

Tab control

Text box control

TrackBar control

TreeView control


© 2004-2021 looksoftware. All rights reserved.