Adding an event handler (a newbie question, perhaps)
Is there a difference between the following 2 lines of code?
Code:
m_ctrPanel.Leave += this.OnLeave;
and
Code:
m_ctrPanel.Leave += new System.EventHandler(this.OnLeave);
Obviously, they serve the same purpose – add event handler.
Any insight or reference is really appreciated!
Cheers,
- Nick
Re: Adding an event handler (a newbie question, perhaps)
Nope, no difference. The compiler can figure it out as long as the delegate type is compatible, it's just syntactic sugar.