The thing is, I don't understand why I should use the "+=" operator like this:
Why not simply use "=" ? If anyone could share this piece of knowledge with me I would be very grateful :)
myTimer.Tick += new EventHandler(myFunc); //myTimer.Tick = myTimer.Tick + new EventHandler(myFunc);
Why should you use the -> operator when accessing the members of an object through a pointer in C++? :) I'm not a fan of the += syntax either, but it makes a bit of sense when you unsubscribe.
Then again, unsubscribing by creating a new object...yeah, it really doesn't make any sort of sense.
myTimer.Tick += new EventHandler(myFunc); //subscribe to Tick event
myTimer.Tick -= new EventHandler(myFunc); //unsubscribe from Tick event
So Microsoft is the answer to this question .. :)
Then it has nothing to do with what the operator is usually used for? I mean like this n += a is the same as n = n + a.
Anyway, thank you both for replying.
It goes without saying that .....to save memory .
I'm a vietnamese I hope everybody will understant it .