General information
Category:
Forms & Form designer
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only