LostFocus Event

Occurs when an object loses the focus.

PROCEDURE Object.LostFocus

Remarks

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

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

Reference

Deactivate Event
Enabled Property (Visual FoxPro)
GotFocus Event
Visible Property (Visual FoxPro)

Other Resources

Events (Visual FoxPro)