In this lecture I will show you the proper way to rename an event handler method.
In that previous like show we renamed one of our event handlers and if you don't do that properly you
can run into errors.
So I'm just gonna show you the right way to do that.
We in our last lecture we created an event handler which is which originally was the mouse down.
So if I click on this picture box and click on this make sure you've got this events highlighted.
If I scrolled down to the mouse down this was the original event handler we created.
So when you double click on that it will generate a code to reflect the name of that event.
So initially it had mouse down.
So if I go here too Initially this force picture books one on the school mouse down.
If you change it from here
you will run into problems later.
The best way to change it is from the design.
Here you come here from the original one.
This is where you change it so ways go the mouse down you changed it down to a click and then you go
back into your code view.
If that doesn't change then you can manually change it down to the click.
And that way you should be able to compile the code.
If you change it in one and not the other you may run into problems.
Also I mentioned the reason why I changed the event handler name from the mouse down to mouse click
it's because I wanted this method.
This from this code I've written for this method to be used by the mouse up key as well.
So to achieve that way I would have gone right to the event I need to look for the event.
So where you've got a mouse up there's a dropdown where you can select event.
I have added this mouse click event.
So that means the code writing for this mouse click will now work for the mouse up as well.
So all you have to do is just for example if I wanted to do one for a mouse move or mouse leave you'd
double click on if you'd drop down to tell you give you a list of all the events that's already available
so you can choose which one for example this one here the dropdown for click on the dropdown euro or
the already has this because I've already attached it.
All right.
So that's how you rename a method.
OK.
That's the proper way.
If you don't do a right you generate a lot of arrows here.
And when you try to compile Visual Studio will complain.
So that's it for this lecture.
Thanks so much for watching.
Bye for now.