Controls Disapear when I Compile Windows Forms

E

Eric Renken

I have come across a strange BUG in VS 2003 that drives me nuts and makes
working in the Windows Form designer sometime impossible. This usually
happens when I have made a lot of changes to a form by deleting then
re-adding a bunch of controls. The problem happens when I try to re-add
controls.

I can add the controls and get them all exactly where I what, and the form
looks good then I compile the project/solution and then everything goes bad.
I get strange errors like: "Duplicate declaration of member 'location'" or
just "Member Not Found". When you double click on them all it does is take
you to the top of the class. When you look at the form generated code you
can tell that most of the properties to tell the control where to display
and its size are missing, so when you look at your form all your controls
are gone in design mode. I end up having to go into the code and deleting
the declarations manually and removing all the code in that was generated by
the designer.

I have looked at the KB article 821309 that is for the problem with
'location', but that says it is only a problem in 2002 and the workaround
didn't work for me anyway. Right now I have one form that I can do this on
pretty much every time I add a control. I can add one control get it like I
want then I save it and check it in. Then I check it out make more changes.
I keep checking in and out so if I make to many changes and everything gets
screwed up I don't have to redo everything again.

We use Vault 3.0 for our source control and this isn't a Vault problem
because I had this issues with Visual Source Safe also.

Any help on this problem would be great. I have tried deleting the RESX
file for the form, but that doesn't help either.

Thanks,

Eric Renken
 
C

Chris Dunaway

This is a longshot, but I have seen weird problems with controls
disappearing/distorting if I had invalid xml in the my app.config file.
I can't imagine the connection between the app.config and the form
designer, but I had a mismatched xml tag and that caused the form
deisigner to go berserk. When I fixed it, my problems went away.

Just a thought
 
E

Eric Renken

Hey thanks for the link. I am on hold for a quick fix now. I think it was
842706, FIX: Controls disappear from the Windows Forms Designer in Visual
Studio .NET 2003.

Will try that and see what happens.

Eric Renken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top