Is it possible to create an array of controls? Is there a way to get the index of a control if more than one of the controls in the array share the same event handler?
Share
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.
This is certainly possible to do. Sharing the event handler is fairly easy to do in this case because the
Buttonwhich raised the event is sent as part of the event args. It will be thesendervalue and can be cast back to aButtonHere is some sample code