How do I delete the generated function from accidentally double clicking on a button?

Viewed 26206

I am working on a forms application with a button. When I double click on it on the designer form, it automatically creates a private void saveButton_Click() function.

How do I delete this function without generating errors in Visual Studio 2012? If I delete the method, it will create an error that states "File does not contain a definition for saveButton_click() and no extension method 'save_button_click'. So how would I delete this method completely as I accidentally created this when I double clicked on the button on designer form?

I can't undo as I have done other changes before trying to fix this. Should I delete something from another file in Visual Studio 2012?

EDIT: I cannot undo (CTRL - Z) as I have saved the files and done other changes as stated above. What I am looking for is a way for Visual Studio to remove all event handlers of when the button is double clicked automatically.

3 Answers
Related