Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding class objects to the form on the fly
Message
De
03/08/2004 12:20:31
 
 
À
03/08/2004 11:54:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00930386
Message ID:
00930399
Vues:
11
Terry,

The name of your object is cntMixAP...not lcPanelName. You can grab a reference to the object with EVAL(), see lines added below.

>
>LOCAL	lcPanelName, loNewPanel
>
>With Thisform
>  .nMixPanelNo		= .nMixPanelNo + 1
>  .Height			= .Height + 62			&& Add enough room for another calc panel
>  .nPanelTop		= .nPanelTop + 62
>  lcPanelName		= "cntMixAP" + ALLTRIM( STR( .nMixPanelNo))
>*TPMcD*	  loNewPanel	= CREATEOBJECT( "mclCntMixAP")
>*TPMcD*	  With loNewPanel
>*TPMcD*	  	.Left	= Thisform.nPanelLeft
>*TPMcD*	  	.Top	= Thisform.nPanelTop
>*TPMcD*	    .Visible	= .T.
>*TPMcD*	  Endwith
>  .AddObject( lcPanelName, "mclCntMixAP")
>  .Refresh()
   oTemp = eval("thisform."+lcPanelName)
   oTemp.Visible = .t.
>Endwith
>
>As it stands, I get:
>
"lcPanelName is not an object"
>when I run
lcPanelName.Visible = .T.
as is to be expected
>
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform