Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lost Focus Or Valid ?
Message
From
23/07/2000 15:37:17
 
 
To
23/07/2000 05:09:39
Tan Aik Jin
Aranea WebLab Sdn Bhd
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00395960
Message ID:
00396000
Views:
6
I use the LostFocus Event.

The reason is that certain validation rules may require the use of a dialog box. If the dialog box uses SetFocus(), an error will occur - you cannot use SetFocus() when called from the Valid Event even if the Valid Event instantiates a form which uses it. You also gain more control over WAIT WINDOW messages, because FoxPro has it's own funky WAIT messages when Valid() returns false.

If you put your validation code in the LostFocus Event, you can use SetFocus() in a called dialog. If the validation fails (e.g. returns .F.), issuing This.SetFocus() in the LostFocus Event returns focus to the control. If I rememeber correctly, NODEFAULT does not return focus in the LostFocus Event.

>For data validation or certain rules validation, do you code in LostFocus() or The Valid() event ? Why do you choose one over another ? Does it offers any superior functionality ?
- Jeff
Previous
Reply
Map
View

Click here to load this message in the networking platform