0
Good afternoon guys, how can I clear the code in the situation where, I put the buttons as a certain use, then we decided to take the buttons but the codes are there, ( the events click ) How can I remove the button and remove events and references without triggering the program ?



It’s not just deleting the event code?
– Jéf Bueno
I did it once and I went down, I don’t want to risk it again
– Fabio Aragão
There is no reason to go wrong, just remove the control and then the code.
– Jéf Bueno
Until then it worked without problems
– Fabio Aragão
That is
FormsorWeb? Search for events in code by name (Button1_click for example), because events can be logged in another location and give error if you remove only the method itself– Ricardo Pontual
Num
WindowsForm, events are recorded in the archive.Designer.cs, if it is aWebFormsold, in the methodInitializeComponent, and so on, so it’s no use just removing from the code, you have to clean in these places as well– Ricardo Pontual
@Ricardopunctual is Windowsform
– Fabio Aragão
Then look for events in the file with the same name as the form with
.Designer.cs, otherwise it will give error if you remove only from the file.cs– Ricardo Pontual