I’m using 2 classes that contains buttons; I added their buttons in my main form, and now I want to do something when the user clicks on one of them. For example, if the user clicks on the button that’s defined in class1, the text of all the buttons that are defined in class1 should change to “class1”. Actually, I need to find the class of a button to change other variables in that class.
Share
In your class, assign event handlers for the click event on the buttons so when you add them to the form and they’re clicked the event handler will fire off inside of your class so you can access the class properties.
Otherwise, add the class reference to the button’s Tag property.
OR