INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Forms & Screen

Why does Lost focus does not retain focus ? by ramani
Posted: 9 Oct 02 (Edited 9 Oct 02)

Often, we use validation code in the LostFocus event instead of in Valid event of a control. There are many reasons to do this way.

What one often forget is that - the lost focus event does not retain focus by the evnt returning .t. or .f. (example.. RETURN .t. or RETURN .f.)

The code should follow the example given below:

myText1.LostFocusEvent
**********************
IF This.Value # myDesiredValue
    MESSAGEBOX("Try again. Value not acceptable",16,"Stop")
    NODEFAULT
ENDIF

The use of NODEFAULT tells the event not to loose the focus and retain it back.

**********************************************************
Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
**********************************************************

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close