Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keyboard {enter}
Message
From
21/07/2008 15:53:50
 
 
To
21/07/2008 14:17:23
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01331438
Message ID:
01332941
Views:
7
>>>Hi,
>>>
>>>When press the commandbutton (represents enter key) is pressed, the focus will shift from textbox2 to textbox3. Thanks
>>
>>How about this......(completely untested)
>>
>>Create a Form Property named (something like) LastTextBox.
>>In the Valid of each textbox put
thisform.LastTextBox = this
>>In the click event of the command button put
thisform.LastTextBox.setFocus
>>KEYBOARD {ENTER}
>>
>
>I would not save any form's object reference in a property of that form.
>Think that form would not close any more

I did a quick test (six textboxes and one command button with no underlying logic) and the form closed ok. I suppose you could also put a "thisform.LastExtBox = .NULL." somewhere in the Release or Destroy or some other method.

Actually, I think my second method (although slightly more difficult to maintain) works much better. The first one has problems when you get past the last textbox and/or have other controls you don't want to reach via the command button.
Previous
Reply
Map
View

Click here to load this message in the networking platform