Is there a faster way to remove un-referenced controls from a Form's designer file?

Posted by Eric on Stack Overflow See other posts from Stack Overflow or by Eric
Published on 2010-06-15T23:24:23Z Indexed on 2010/06/15 23:42 UTC
Read the original article Hit count: 109

Filed under:
|
|

I started looking into the designer file of one of my Forms and noticed that a lot of the old controls I thought I had deleted are still being instantiated but are not actually used on the form.

Is there any easy way to clean up these controls from the designer file that are not being used? Right now I've printed out a list of all the private fields at the bottom of the designer file that reference the controls of the form. I'm going down the list one by one trying to determine if the control is actually used or not, and then deleting those that I find are not on the form. The document outline is useful for figuring out what controls are on the form, but this is still a rather tedious process. Does anyone have a better way?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about visual-studio-2008