kinda difficult to explain but is there a way to do something like:
control1.ShownEditor += EventHandler;
...
control2.ShownEditor += control1.ShownEditor; //wrong
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.
Simply: you cannot use an
EventHandlerof a control’s event and assign it to another event. So this isn’t possible:The only way is to create an
EventHandlerseparately and assign it to both the controls’ event.Another harmful solution could be extract the delegate via
Reflection, but as I said it’s actually dangerous, look this answer by Hans Passant: Is it possible to “steal” an event handler from one control and give it to another?.