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

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

Click here to load this message in the networking platform