Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trouble with Switching Focus
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00344865
Message ID:
00344884
Views:
22
Hi Michael.

>>However, if I happen to click anywhere else on the form itself, while the combo box is opened, I get an error saying that the setfocus command is not allowed in a valid clause. This doesn't make sense, because the setfocus command works fine from within the combo box. <<

The fact that you can issue a SetFocus() from the Valid() of a combo box is the anomaly. The Valid method is used to decide if a control should be allowed to lose focus. Try switching your setFocus() from the Valid of the combo to the LostFocus(). And don't forget to add a NODEFAULT after you issue the SetFocus() when you move the code to the LostFocus method.

Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform