Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot call SetFocus from When, Valid event.
Message
From
08/07/1999 10:17:46
 
 
To
08/07/1999 08:44:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00238797
Message ID:
00238849
Views:
11
Hi Marten.

>Why have Microsoft remove this function? In VFP3 it works just fine but in VFP6 I get an error message. I've used SetFocus a lot from When and Valid and now it couses me serious problems finding all the errors. But that wasn't really my question.
>From now on I don't use SetFocus from When and Valid Method but now I have run in to another problem. If When or Valid calls another form which then run a SetFocus in the "Init-sequence" then you also get the error message!?!? Why? This is VERY VERY annoing and i wounder if there is anyway to get around this? The error searching becomes so much harder if this is also a limit in VFP6.
>
>/Mårten Törnquist

The reason that you can no longer call SetFocus from Valid is that the valid method is used to decide whether or not the current control should lose focus in the first place. And, as you have already noticed, it is indeed true that VFP will give you an error if there is a Valid anywhere in the call stack.

What you can do, is do the SetFocus() to another control in the LostFocus() of the current control and follow the SetFocus() with a NODEFAULT.

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform