GotFocus, LostFocus
These events fire when an object gains or loses focus. They're similar to the When and Valid events, but don't include any testing to see whether the object can get or lose the focus. Also, unlike Valid, LostFocus fires every time focus leaves the control, whether or not the user has actually used the control.
Usage |
PROCEDURE oObject.GotFocus | oObject.LostFocus [ LPARAMETERS nIndex ] |
Example |
* You might enable/disable certain options only when you're * sitting on a particular control. In this case, we enable * a button as we go in and disable it on the way out. PROCEDURE edtDetails.GotFocus * Enable the button to show more details ThisForm.cmdBlowItUp.Enabled = .T. ENDPROC PROCEDURE edtDetails.LostFocus * Disable the details button ThisForm.cmdBlowItUp.Enabled = .F. ENDPROC |
See Also |