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


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .