I am moving from Delphi to C#. In Delphi IDE, when I change a control's name, the names for all the events created previously which are related with this control will be changed automatically. But in C# IDE, this is not the case.
When I drop a button on the form named button1, then I create a click event by double clicking the button. The name for the event will be button1_Click. Latter I change the name for the button from button1 to btnCancel. I expect the name for the clicking event should be btnCancel_Click, but it still stays the same.
Is there any way for C# IDE to do the same as Delphi's IDE

control's name is changed, its event's name stays the same
slickred
In C# the name of an event is independent of what object it is handling. VB.NET works a little differently. If you want to force the renaming across the board then you could try using rename from the context menu of the field itself rather than through the property grid. I'm not sure it'll work. Otherwise you'll be stuck using replace to find all instances. You could also try opening the events for the control in property grid and try typing in the updated name there to see if it is smart enough to rename the handler but I don't think it is.
Personally I don't name events based upon the control they're attached to as I find this to be somewhat uninformative. Instead I prefer to give my event handlers descriptive names like OnNameChanged. That's just me though.
Michael Taylor - 11/13/06