dbTalk Databases Forums  

VFP 6: Valid vs. LostFocus

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 6: Valid vs. LostFocus in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP 6: Valid vs. LostFocus - 07-21-2004 , 06:29 PM






I wrote my app using .valid() code. Later, I read here that
..lostfocus() is better. Since I am now adjusting that part of the
app, I wish to review this decision.

Big plus to using .lostfocus(): .setfocus() is not valid in
..valid() but is in .lostfocus().

If I simply change the .valid()s to .lostfocus()s, what am I
going to lose? I know that I will lose returning a non-zero value to
determine how many controls forward or back to move, but I do not use
that anyway. Is there any other gotcha waiting to sink its teeth into
me?

Sincerely,

Gene Wirchekno

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Fred Taylor
 
Posts: n/a

Default Re: VFP 6: Valid vs. LostFocus - 07-22-2004 , 01:06 AM






Just be sure to include a NODEFAULT in your code in the .LostFocus() where
you do your .SetFocus(), else you'll advance a field past where you expected
to be.

Fred
Microsoft Visual FoxPro MVP


"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> wrote

Quote:
I wrote my app using .valid() code. Later, I read here that
.lostfocus() is better. Since I am now adjusting that part of the
app, I wish to review this decision.

Big plus to using .lostfocus(): .setfocus() is not valid in
.valid() but is in .lostfocus().

If I simply change the .valid()s to .lostfocus()s, what am I
going to lose? I know that I will lose returning a non-zero value to
determine how many controls forward or back to move, but I do not use
that anyway. Is there any other gotcha waiting to sink its teeth into
me?

Sincerely,

Gene Wirchekno

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #3  
Old   
Stefan Wuebbe
 
Posts: n/a

Default Re: VFP 6: Valid vs. LostFocus - 07-22-2004 , 04:53 AM



Hi Gene,

Quote:
Is there any other gotcha waiting to sink its teeth into
me?
One could be that LostFocus() takes place later than Valid(),
sometimes even later than nextControl.When(), especially
while navigating by mouse instead of <tab>
Probably rather an advantage than a problem?, just in case
your code relies upon that particular event sequence
somewhere...


-Stefan

"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> schrieb im Newsbeitrag
news:5dutf0holroh2sp6hh0dbc4m8hl39tdn2g (AT) 4ax (DOT) com...
Quote:
I wrote my app using .valid() code. Later, I read here that
.lostfocus() is better. Since I am now adjusting that part of the
app, I wish to review this decision.

Big plus to using .lostfocus(): .setfocus() is not valid in
.valid() but is in .lostfocus().

If I simply change the .valid()s to .lostfocus()s, what am I
going to lose? I know that I will lose returning a non-zero value to
determine how many controls forward or back to move, but I do not use
that anyway. Is there any other gotcha waiting to sink its teeth into
me?

Sincerely,

Gene Wirchekno

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.