Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Previous Active object
Message
From
01/08/2001 15:06:52
 
 
To
01/08/2001 13:30:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00538416
Message ID:
00538478
Views:
14
>I have a form with many objects (textboxes, checkboxes, etc) and on some of my commandboxes, I would like to setfocus to the
>object that had the control when the command was clicked. I can do this with programming by saving the object name and parents
>when the object gets the focus, but is there another way. I am using VFP6.

Actually, I'd save the object to form property, thisform.oLastControl, and then in the lostFocus of every base class you have (you are using base classes, right? *s*) do something like thisform.oLastControl = this. Then in the command button's click, after you do your work you could THISFORM.oLastControl.SetFocus(). This should work fine if you take care of a couple of details.

Set the property thisform.oLastControl to .NULL. in the form destroy.

Make sure you initialize the property when the form initializes in case that's the first thing a user does, or you'll get an error.

Don't ever programmatically call the click() method from a valid().

Other than that, no, there really isn't another way to do it (that I can think of).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform