Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transfer focus to previous control with focus after use
Message
From
25/01/2000 13:52:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322283
Message ID:
00322330
Views:
24
>I'm not sure how WHEN helps me. How does WHEN give me the reference to the control 'passing' the focus? Could you further explain?
>
>Is it possible to add the property to my navbutton class instead of the form to hold the object reference? I want to try to keep my classes as self contained and reliant as possible. If so, would this work?
> Thisform.(This.LastObjFocus).SetFocus
>Where This.LastObjFocus is the property and set to the name of the last object with focus provided by WHEN.
>If my syntax is ridiculous above, please excuse me. I get a little lost in dot notations especially in combination with (), m., and & usage. Thanks

The WHEN would be useful as it is the point that each control gets the focus. Create a form property LastObjFocus (if that's what you want to call it). Now in the WHEN of EACH CONTROL, you'll need to do:
THISFORM.LastObjFocus = THIS

This will be easier to add to all of your controls baseclasses. (You did subclass all the Fox classes, didn't you? :))

Now, after you've done your Navbutton processing, you would do a _SCREEN.ActiveForm.LastObjFocus.SetFocus()
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform