To handle an event, I use the code as below:
obj.Evt += new EvtEventHandler(DoEvt);
or
obj.Evt += DoEvt;
will make same result;
So… Please tell me which one I should choose! And why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that
Evtis typed asEvtEventHandlerthen there is no difference (unless you use C# 1.2, where only the first exists).Use whichever you want.