Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Protected & Hidden Properties
Message
De
23/08/1998 11:53:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Protected & Hidden Properties
Divers
Thread ID:
00129133
Message ID:
00129133
Vues:
58
I am confused about custom properties of classes.

In a class I tried out, I have these two properties that I do NOT want the user to change - oldleft and oldtop. I can make them PROTECTED and then the user cannot change them. But when I try to access them outside the PARENT eg if I have a cmdButton on the form and need to access these properties from its CLICK Method -

THIS.PARENT.oldtop = 10

I get the error that the property was not found.

If I create a custom method for the class then I can access this protected property from it

THIS.oldtop = 10 is OK!

How do I get to these properties (PROTECTED) from methods whithin other members of the same class??

I can find no sample code to help me here.

So THIS.CustomProtectedProperty is OK but

THIS.PARENT.CustomProtectedProperty gives error property not found.
The same with HIDDEN. I can only acces these properties if I make them PUBLIC which defeats the purpose.

Can someone help as it is driving me crazy.

Bernard
boutb@powerup.com.au
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform