PRB: SetFocus Does Not Function in All Control Methods (156632)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q156632 SYMPTOMS
In Visual FoxPro 5.0, the SetFocus method does not function in the VALID,
WHEN, RANGEHIGH, and RANGELOW methods of TextBox, EditBox, and Spinner
controls. Attempting to use the method will result in the error:
"Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow
event."
NOTE: The error occurs if some other control's method is called that calls
a SetFocus. That is, this error occurs if any of the events (When, Valid,
RangeHigh, RangeLow) somewhere lower in the call stack calls the SetFocus.
Example: The VALID calls a CLICK that calls a CLICK that calls a SETFOCUS;
the error still occurs.
WORKAROUND
Call the SETFOCUS method in the LOSTFOCUS and GOTFOCUS methods rather than
in the VALID and WHEN methods.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 10/15/2003 |
---|
Keywords: | kbprb KB156632 |
---|
|