Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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'm not most, but I'd use Thisform. simply because if you move/copy the code for any reason, it doesn't break.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement