The information in this article applies to:
SYMPTOMS
The SetFocus method does not set the focus to the specified control if
placed in the Valid event procedure code of the following controls: list
box, text box, combo box, spinner, and edit box. Instead, the focus is
placed on the next control in the Tab order.
CAUSEControl is passed from the current control to the control whose SetFocus method is called, then returns to execute the LostFocus event of the current control. Then the LostFocus by default sets the focus to the next control in the Tab order. WORKAROUND
Call the SetFocus method for the desired control in the LostFocus event of
the current control, rather than in the Valid event.
STATUSThis behavior is by design. MORE INFORMATIONIn FoxPro version 2.x, the _CUROBJ system variable was used to select the object where the cursor was to be moved. This was often placed in the Valid code snippet of an object. The SetFocus method is used in Visual FoxPro to perform the same functionality, but will not work as expected in the Valid event of certain controls. Steps to Reproduce Behavior
Additional query words: VFoxWin
Keywords : kbVFp300 FxprgGeneral |
Last Reviewed: August 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |