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 KumarRank #7,836 · 233 reputationPosted Feb 26, 2010, 5:04 AM EST
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
GustavoRank #1,990 · 732 reputationPosted Feb 26, 2010, 5:10 AM EST
Thanks... I was hoping that there would be a better way.
Dushan Stankovic72 reputationPosted Feb 26, 2010, 6:47 AM EST
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);
Sam HobbsRank #107 · 20.5K reputationPosted Feb 27, 2010, 12:54 PM EST