Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does a control refer to itself?
Message
 
To
27/03/2008 14:14:38
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01305989
Message ID:
01306268
Views:
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.

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!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform