Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Renaming controls without messing up code?
Message
 
To
28/03/2008 09:31:46
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01306371
Message ID:
01306457
Views:
4
The eventhandler names are not renamed and should not be renamed because multiple objects can "link" to the same evenhandler.

>I tried it, and it seemed to work, except that it did not rename the event handlers.
>
>I refactored from "mmDataGridView1" to "mmGridCustomers" and it did not hit the event handlers:
>
>
>
> private void mmDataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
> {
> string CustNo = this.mmGridCustomers.GetCurrentRowPK();
>
>
> }
>
>>Don't do it in the property sheet. Find a reference to it in the code. Right-click on it and select Refactor.
>>
>>>On a Windows Forms, how can I rename a control (using the Properties window in the IDE) knowing that there may be many event handlers and other references to the old name in other places in my codes?
>>>
>>>If you rename it immediately after placing it, you're ok, but what if you have already coded against it and then decide to rename it how do you fix all the references? Will it do it automatically or do I have to find all the places that need to be changed? Where all should I look?
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform