Hello sherri,
"this" means the same class.
Use direct method calls without this.
"this" solves ambiguity, for example you have class with 2 variables, method
CallMe() that takes the similiar variables as params and you need to assign
method param to the class variable
class MyClass
{
private string variable1;
private string variable2
public void CallMe(string variable1)
{
// which variable to assign?
// variable1 = variable1
// this solve this. we assign MyClass.variable1 to the method's variable1
this.variable1 = variable1
}
}
s> I was wondering what the difference was between calling a method this
s> way:
s> SomeMethod()
s> and this way:
s> this.SomeMethod();
s> when calling one method from another within a form. Is one preferred
s> over the other? When should one be used over the other?
s>
s> Thanks!
s>
s> S
s>
---
WBR,
Michael Nemtsev :: blog:
http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche