tags:

views:

105

answers:

1

How do you make Visual Studio C# Express 2008 refactor the name of events when object is renamed?

Let's say I have an object named txtCars and it already has an event handler for on txtCarsTextChanged and I rename the object from txtCars to txtTrucks. Everything else is refactored but the event txtCarsTextChanged isn't. Is there a shortcut to make it all refactor or atleast along with the events, even on the form design.cs file without having to edit the event name and back in the form designer.cs file manually?

A: 

If you mean that you'd like txtCarsTextChanged when you rename the txtCars object, then I'm afraid the answer is no. However, you can right click the name of the event and perform a separate Rename refactor on it as well. That should pick up any instance of where that event is used, including designer generated code.

Andy
Thank you for the quick response.