Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus()
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00198693
Message ID:
00198879
Views:
15
>It is a bug, in my opinion. I can understand why SetFocus should not be in the valid method of the control when referring to focus in the same container as that control (ie. you can't set focus to something else yet, we don't even know that you can leave this field until you return .T.). But when you are within a modal lookup form or other type of modal form, it just doesn't make sense to me.
>
>One example that I can think of is this: You have this Valid method. It calls a lookup form. A value is returned from the lookup form and a calculation of some type is done within the Valid method. If the calculation gives a result that is for some reason invalid, you want to stay in that control (return .F. from the Valid method). Well, does this mean that any lookup form should NEVER use a SetFocus because it might some day be called from Valid method code?
>
>Hey, you could work around it. But it should not need a workaround.

I think The trend really is to no longer use Valid much, and use Lostfocus for pretty much all control exit-checking. That theory is supported by the setfocus/valid problem...I find it easier just to keep all my exit-checking code all in one place (Lostfocus), now that I've gotten used to it...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform