Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 795 Bytes

File metadata and controls

24 lines (16 loc) · 795 Bytes

SetFocus

This method is Visual FoxPro's answer to _CUROBJ. It allows you to set the focus to any control.

Usage

oObject.SetFocus()

SetFocus works kind of inside out from the way _CUROBJ does its stuff. With _CUROBJ, you assign a value that leads to the object you want. In the new, OOP paradigm, you call the SetFocus method for the object you want to receive focus.

SetFocus can't be called from some methods. The ones you're likely to run into are When and Valid. Make your calls from GotFocus and LostFocus instead.

Example

* In a form to edit Employee records,
* the Click method for the "Edit" button might:
ThisForm.First_Name.SetFocus()

See Also

GotFocus, LostFocus, _CurObj