Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hiding Class Members
Message
From
04/09/2007 13:28:14
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brazil
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01252234
Message ID:
01252266
Views:
10
Hi Kevin,


>You can go into the Edit Property/Method dialog and set the Visibility for an object on a container
>to Protected, and it will not be visible from outside the class.
>
>Is there way to do this to controls that are added programatically?


Try. Put the code below in a program (called of "prgClass"):
DEFINE CLASS myClass as Container
	PROTECTED txt1 as TextBox
	txt2 = .F.
	
	PROCEDURE init()
		this.txt1 = CREATEOBJECT([TextBox])
		this.txt2 = CREATEOBJECT([TextBox])
	ENDPROC
ENDDEFINE
After, create the object based in "myClass" and try to access "txt1" and "txt2", thus:
* You can to do this in command window.
SET PROCEDURE TO prgClass
loMyObject = CREATEOBJECT([myClass])

MESSAGEBOX(loMyObject.txt1.Name)   && Here occur error
MESSAGEBOX(loMyObject.txt2.Name)   && Here work fine
I hope this help you.
Good luck!
Erick
Força Sempre!
Strength Always!
Previous
Reply
Map
View

Click here to load this message in the networking platform