Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove unused Clicked event from C# project

Tags:

c#-3.0

I am newbie in C#. while working in Windows Forms Designer if any controls get double-clicked by mistake it places the clicked event on the Form.cs (ie: private void UserAddBtn_Click(object sender, EventArgs e). how can I remove all the references of this event while staying in Forms designer or w/o going thru manual removal.

Thanks in advance....

like image 791
Afzal N Avatar asked Jan 21 '23 08:01

Afzal N


2 Answers

You can clear the event handler by deleting it from the properties dialog.

Go to the events tab and find the double click event. You can then delete the event handler from there.

like image 111
ChrisF Avatar answered Apr 30 '23 11:04

ChrisF


if you select the item you want to remove in the form designer, then right click on the lightning bolt and click "reset" it works for me. I couldn't make it work as explained above. I'm using Visual studio express 2013 V12 - Update 4.

like image 42
agleno Avatar answered Apr 30 '23 13:04

agleno