Possible Duplicate:
What is the purpose of 'this' keyword in C#.
Hello,
I have a question about something. I have had a look around, but can't seem to figure it out.
Why do some programmers use this
in-front of something? Like:
this.button1 = String.Empty;
In MSDN, I don't ever recall seeing this.
being used unless this.
was referring to the Form itself, like this:
this.WindowState = FormWindowState.Minimized;
Is this how we're really supposed to reference things? Or, are there added benefits to doing it this way? So far, I have not experienced any noticeable benefits, not have I noticed any changes.
Thank you :-)
this
means, not why it is used like @Lucifer desribes in the auto-generated Forms code.this.
a lot. now its irrelevant I guess. btw whats this.button1 = String.Empty; :)this
but also states where you don't have to usethis
. i.e. in the example posted by the OP. If you don't agree then don't cast a close vote :)