Hello:
I have some un-used code and would like to clean up my application. Example below is the kind of code that I would like to remove.
private void tabPage1_Click(object sender, EventArgs e)
{
}
If I comment the lines, I can not run the application. How can I remove this from everywhere in the project?
I have a bunch of items like this thruout my project.
Loading
Raaj KumarPosted Feb 26, 2010, 10:04 AM
The shortest method is using Find and replace. In find window type the method name and click find. It will navigate to the place where it is been used.
Other one is Right-Click on the method and select Find All Reference
Regards,
raaj
Sam HobbsPosted Feb 27, 2010, 5:54 PM
Dushan StankovicPosted Feb 26, 2010, 11:47 AM
You must go to designer and find control like tabPage1_Click (TabPage control) and remove in events that eventHandler. After that you can delete that function or it will be removed after you save project. If you delete function before you remove eventHandler you will have error. Then must go to .Designer.cs file and for that control erese code like this:
this.tabPage1.Click += new System.EventHandler(this.tabPage1_Click);
GustavoPosted Feb 26, 2010, 10:10 AM
Thanks... I was hoping that there would be a better way.