views:

308

answers:

1

Hi,

I have a form which has several buttons, labels and other stuff on it, but the designer appears to remember old elements of that form that have previously be deleted.

Is there anyway to 'refresh' the form.Designer.cs code to inform it what elements are currently on the form and what elements are not.

Cheers for the help in advance ;)

+2  A: 

If they are still in the designer file after a restart of VS and a re-open of the designer then they haven't been deleted yet. I've seen several cases where people think that variables are deleted but what's happen is they've been moved off of the visible area of a form. So they still exist but they're not doing anything interesting.

What you can do is close the designer, carefully delete all of the variables you want from the designer.cs file, recompile and re-open the designer. Before doing this I would backup the file though as it is possible to mess up your control by doing this.

JaredPar