Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus
Message
 
To
27/06/1998 08:33:43
Ed Hizon
Skswood Sdn. Bhd
Kuala Belait, Brunei
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00111903
Message ID:
00112417
Views:
25
>I have tried this and setfocus to the other column, but to get back the focus to the addbutton it will do the same. So I still can't get back to the addbutton.

Okay, this is ugly, but here's a workaround to the unwanted extra event-firing (I'm not sure if it's bug or design, but it's still present behavior in vfp6 beta):

1) create a property at form level, like "qty_done"
2) set it .F. in your cmdadd button click
3) set it true in the When of the qty textbox
4) in each of gotfocus,valid, and lostfocus put no code
5) in qty textbox keypress, put

if nkeycode = 13 && 'enter pressed'
thisform.cmdadd.setfocus
endif

Something like this should work...you could do a validity check, etc., on return to cmdadd, based on qty_done...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform