Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I want to stay on a field?
Message
 
To
11/09/1997 17:53:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00049609
Message ID:
00049819
Views:
44
>>How do I send the FOCUS back to a field from a VALID?
>RETURN .F. or RETURN 0 or RETURN [tabordernextfield of interest]
>It's easy to get trapped in WHEN/VALID now so I try to only got/set/lostfocus and use the lostfocus event for validation and repositioning. Usually any gotfocus() code is ok to prime the field for the user (i.e. reset to empty/null/default this.value stuff)
>HTH
Gary,

Here's my take on When/GotFocus and Valid/LostFocus

WHEN: Decide if the user should be allowed in this control at all (ONLY This do not set up control here)

GOTFOCUS: SEt up control for focus (if this event fires the user is in because they passed the When test)

VALID: Decide if the user will allowed to leave this control (Do NOT react to their leaving here)

LOSTFOCUS: React to the focus leaving this control (because if this event fires they have passed the Valid test)

This is not an either or situation, it is best to make the proper use of all four events. To make proper use one needs to know the event sequence;

Moving to a control:

WHEN If When test is passed ------> GotFocus
If When test failed -------------> When of next control


Moving off of a control:

VALID If Valid test passed --------> LostFocus
If Valid test failed -----------> Focus remains in this control (LostFocus does NOT fire)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform