0

I ve always had a problem with this but never coped with it.
Let s say I bring a button to a form and click on it two times
a event will appeaer in the code section.
EXAMPLE:

private void button1_Click(object sender, EventArgs e)
        {

        }

Let s say i want to remove the BUTTON and the event by erasing them manually.
After that i get plenty of warnings wich is reasonable. Just wanted to ask how
do i do this safely or is there anything else i would have to erase in order to
avoid warnings...

2
Contributors
1
Reply
10
Views
3 Years
Discussion Span
Last Post by deceptikon
1

If you don't add any code to the event handler, simply resetting it in the control properties will delete the code as well. If you do add code (even if you delete it immediately), the best approach is to delete the handler manually and also reset it in the control properties.

If you want to go full manual, you can find where the handler is attached in your compiler generated code and remove that rather than do it from the designer.

Votes + Comments
TNX!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.