Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding class objects to the form on the fly
Message
From
03/08/2004 12:20:31
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00930386
Message ID:
00930399
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform