共用方式為


LostFocus Event

Occurs when an object loses the focus.

PROCEDURE Object.LostFocus
[LPARAMETERS nIndex]

Parameters

  • nIndex
    Uniquely identifies a control if it is in a control array.

Remarks

The timing of this event occurs depends on the type of object:

  • A control loses the focus by user action, such as tabbing to or clicking another control, or by changing the focus in code using the SetFocus method. A Grid loses the focus when a user presses CTRL+TAB in Microsoft Windows or CONTROL+TAB on the Macintosh to exit the Grid.
  • A form loses the focus when the form has no controls, all its controls have their Enabled and Visible properties set to false (.F.), or another form gets the focus.

For forms, the LostFocus event occurs before the Deactivate event.

See Also

Deactivate Event | Enabled Property | GotFocus Event | Visible Property

Applies To: CheckBox | ComboBox | CommandButton | Container Object | Control Object | EditBox | Form | ListBox | OLE Bound Control | OLE Container Control | OptionButton | Spinner | TextBox