Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does a control refer to itself?
Message
 
À
27/03/2008 14:14:38
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01305989
Message ID:
01306268
Vues:
3
>>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.

You bet. It can save a LOT of headaches.

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

Carry a baseball bat when meeting with other developers and use it pro-actively.

>~~Bonnie
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform