Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Holding the name of a control as a string?
Message
De
05/03/2002 16:13:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00628023
Message ID:
00628665
Vues:
31
Chris,

One more thing. I noticed earlier in the thread it appears you want to set focus to a particular control on the form...and I assume you want the most recent. Instead of storing the name of the control in a string, you can store a reference to the control in a property of the form.

For example, in the lostfocus() of the controls on your form:
* text1.lostfocus()
thisform.currentControl = this
Then, in your form's queryunload(), if you are going to keep the form open you simply:
thisform.currentControl.setfocus()
Of course you can add code to your custom classes so you don't have to add code to the lostfocus() method of every control on your forms...

HTH,

steve

>Yep that's the idea - they can flick about opening one form after another (when each form opens I store away it's name and when another form is launched I first programmatically close the previous form...) the idea is that in the lost focus I detect any changes made and trap the user on the form.
>
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform