Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Previous Active object
Message
De
01/08/2001 15:06:52
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
01/08/2001 13:30:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00538416
Message ID:
00538478
Vues:
12
>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).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform