-
January 25th, 2011, 06:51 PM
#1
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
-
January 25th, 2011, 06:53 PM
#2
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|