Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best practice for referring to form in form methods.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01365701
Message ID:
01365725
Vues:
14
>>When I’m writing a form class or a form.scx with custom methods, what is the best practice for referring to the form itself in its method code?
>>
>>Should you use:
>>
>> This.PropertyName and This.MethodName()
>>
>> or
>>
>>ThisForm.PropertyName and ThisForm.MethodName()
>>
>>
>>So it’s a question of “this” vs. “thisform”
>>
>>In the case of a form they both get you to same place.
>>
>>So, what are most of you doing?
>
I like to make a reference to what object I am calling like

oObject = Thisform (or oObject =This.Parent.pgf1.page2.grid )

then in my code I enter oObject.MethodName or oObject.PropertyName

so it becomes transparent after I assigning the oObject to what ever

(sent last message befor checking my spelling!)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform