Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus without using setfocus()
Message
From
28/02/2004 20:38:08
 
 
To
28/02/2004 17:22:07
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00881299
Message ID:
00881836
Views:
25
Hi!

Just change the "this.setfocus()" to "nodefault" in the lostfocus of the control

Sarosh

procedure lostfocus
if empty(this.value)
messagebox('Invalid')
*this.setfocus()
nodefault
endif


>>Hi!
>>
>>Don't use the Valid Event use LostFocus instead and then if you want to stay in that same control maybe your validation routine returns false then just setfocus back to the same control [This.SetFocus()]
>>
>>Sarosh
>
>If I put two textboxes on a form. One with...
>procedure lostfocus
>if empty(this.value)
> messagebox('Invalid')
> this.setfocus()
>endif
>
>and the other with
>procedure gotfocus
>messagebox('Got me')
>
>You will see that on tabbing out of box 1 you still get both messages and box 2 gets the focus anyway!
Previous
Reply
Map
View

Click here to load this message in the networking platform