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

strCommand = "thisform." + alltrim(strControl) + ".setfocus()"
&strCommand

Hope it helps.



>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!!!
Brian McCord
President
Sagacity Systems
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform