Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus in When event.
Message
 
To
02/07/1999 03:00:37
Salminen Jukka
Js Software Systems
Vaasa, Finland
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00235715
Message ID:
00236821
Views:
19
>>You can use the GotFocus and when calling a setfocus also issue a NODEFAULT.
>
>Could you give some examples where/why NODEFAULT should be used. I'm also new to VFP>3.
>
>Jukka Salminen

Jukka,

NODEFAULT prevents the VFP default behavior from occuring. For example, in the QueryUnload the VFP default behavior is to destroy the form. If you don't want the form destroyed you must issue NODEFAULT.

In the GotFocus the default behavior is to set focus to the object, if you don't want focus there you need to issue a NODEFAULT. Why is it needed? Because the VFP default behavior occurs after your code. So in the GotFocus example, your code would set focus to some other control, but then VFP would set focus to the current one after your focus move. This would make it appear like your SetFocus call was ignored when, in fact, it was not ignored just overridden after.
Previous
Reply
Map
View

Click here to load this message in the networking platform