VS will do this if the event handler already exists, but has been disconnected from the event.
You can reproduce this behavior as follows.
What you may not realize is that in addition to the code-behind, there is also a file for the designer and the .resx. I'm not sure which one has what, and I am not at a PC with Visual Studio, but in one of those files, there is a bunch of code defining the button, including a line that starts with
Button1.Click += new EventHandler
or something along those lines.
At this point all is good.. NOW to disconnect the button from the event...
- In the form designer, delete the button
At this point, the Button1_click event handler still exists in code behind but is not tied to an event (because the button whose event it was tied to has been deleted.)
- Drag a new button onto the form (still named Button_1)
At this point, there is a new Button_1, but the event handler is still not tied to your original Button1_Click event. So if you double-click on the button, a new eventhandler will be created (Button1_Click1())