Answer the question
In order to leave comments, you need to log in
How to remove an event handler in Windows Forms?
Hello!
I recently started to understand Windows Forms and ran into the following problem. It happens that when creating a button, you accidentally click on it a couple of times and an event handler of the type is automatically created:
private void button1_Click(object sender, EventArgs e)
{
}
Answer the question
In order to leave comments, you need to log in
Right click find references and delete this line. The other way is just to remove this function and the compiler will complain about an error, go there and double again. Select the third button in the designer and look at the handler in the properties, just delete it there. All these methods are equivalent, there is still truth
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question