Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing controls with setfocus()
Message
From
24/08/2008 22:38:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
24/08/2008 15:12:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01341355
Message ID:
01341421
Views:
15
>Your suggested approach is quite similar to what I had started trying. The key from your post was that there is no magic bullet solution, so you got me back to work on the problem. It’s working now, and here’s what I ended up with:
>
>A global (public) variable gcCameFrom
>
>For each txtBox, or other control, that changed the grid’s RecordSource content
>In GotFocus()
gcCameFrom = This.Name
Except that this.name is relative to .parent; if you have instantiated a same composite class several places - say, a container with two or three textboxes to enter phone number, area code, internat country code etc - the members of that container will have the same names in every instance, names you can't change.

I'd suggest
gcCameFrom=sys(1272, this)
which would give you full hierarchy, or even
goCameFrom=this
as a direct object reference, but in that case you'd have to make sure you clear that when your form loses focus.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform