Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does a control refer to itself?
Message
De
27/03/2008 14:14:38
 
 
À
27/03/2008 04:27:40
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01305989
Message ID:
01306266
Vues:
4
>Where is this code? In a Form?
>In that case since the mmDataGridView1_CellContentClick() method belongs to the Form then 'this' refers to the form. In short 'this' always refers to the class in which it is contained (except in extension methods). I don't see how this (no pun intended) differs from VFP behaviour.
>BTW the 'This.' isn't needed unless there can be ambiquity.


Viv -- just wanted to comment on the use of "this" ... I prefer that it is *always* used when needed. That way it is easy to tell at a glance whether you are referencing a field on the control (from the declarations), or simply a variable in the method you're currently in.

I have a hard time enforcing my whims on other developers though (and it drives me nuts to look at their code <g>)

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform