Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Holding the name of a control as a string?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00628023
Message ID:
00628024
Vues:
21
>Hi another simple one but I am useless at this!!!
>
>I am storeing the name of the last control a user was in on a form in a form property and I have this in the lostfocus of the form...
>
>
>local lnAnswer, strControl
>
>if thisform.mDataChanged()
>
>lnAnswer = messagebox('     Please Save or Undo changes before launching another screen...          ', ;
>0 + 64 + 0, 'System Message')
>strControl = thisform.pLastControl
>if !strControl = ""
>if pemstatus(thisform, (strControl), 5)
>thisform.(&strControl).setfocus()
>endif
>endif
>thisform.(strControl).setfocus()
>thisform.mGetStatus()
>return .f.
>endif
>
>BUT I cannot get the thisform.thisbloomingcontrol.setfocus() right - I have tried &strControl [strControl] and everything in between... please put me out of my mysery!!!


Why not
loControl = EVALUATE("ThisForm." + strControl)
then
loControl.SetFocus?
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform