Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting first field and exiting last
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00155566
Message ID:
00156008
Views:
34
I think a cleaner (and more dependable) way to handle this would be to get an object reference using EVAL, and then call setfocus with that reference:

IF this.name = thisform.lastcontrol
oControl = EVAL(thisform.FirstControl)
oControl.setfocus()
ENDIF

this will get around the quirkiness of macro expansion and 'THISFORM'.

>Vicki, if you do it with the first/last form properties, then you don't need to work with the CONTROLS object. All you need in the textbox class is a call in the lostfocus to check the property:
>IF this.name = thisform.lastcontrol
>   this.parent.&thisform.firstcontrol..setfocus()
>ENDIF
>
>This is NOT tested code - I've found macros don't usually work with a 'thisform' in them, so you'll have to adjust for that.... But I hope it gets you started.
>
>Barbara
>
>
>
>>Are my textboxes subclassed - you bet. But not all my fields are text boxes tho all are subclassed. My concern was having to put code in every field but I didn't think about setting a "first" and "last" as form properties and noting it that way. It allows me to set it once and change it (if needed) without dealing with each field. Great! Now, if I can figure out how to work with the Controls code, I'll be on my way<g>. Thanks.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform