Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus on textBox
Message
From
21/12/2018 12:01:06
 
 
To
21/12/2018 09:32:12
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01664774
Message ID:
01664786
Views:
69
>>>>Hi,
>>>>I would like my users to set the focus on a textbox with KeyStrokes,
>>>>Since a txtbox does not have a caption where I can set the \< I have set the Caption of Label to
>>>>
This\<Textbox
>>>>and since label has no GotFocus
>>>>I set the the ThisForm.textbox1.setFocus in KeyPress method when nKeyCode, nShiftAltCtrl parameters are according to Alt+T values. Form has KeuyPreview=.t.
>>>>However it does not work, no setfocus in textbox,
>>>>Anybody around with a better idea?
>>>>regards,
>>>>Koen
>>>
>>>I know this is not the "correct" way to do it, but this is the solution I have used for ages. Add a label with the caption you want, including \<. Let this label have the tabstop "before", meaning one less than, the textbox you want to set focus to.
>>
>>Tore,
>>Why should this not be the correct way? It is the correct way, since it works like a charm and does not effect any other functionalities on the form. Thanks a lot. Great!
>>Best regards,
>>Koen
>
>You're welcome.
>
>I seem to remember that there is another way, which is the "correct way" according to "the books".
>
>BTW, this is one of the few cases where I use a wizard, although it's not called a wizard. To change the tab order: View->Tab Order->Assign by List.

One occasional annoyance I remember running into is in the case where if Send to Back" or "Bring to Front" was used, the objects sometimes get "stuck" in that position and re-ordering the taborder doesn't work as expected. In those cases I had to open the form as a table and edit the properties (i.e. either swap the order or simply remove them altogether).
Previous
Reply
Map
View

Click here to load this message in the networking platform