Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Controls disappear from a form although they are still in the Designer code

$
0
0
I've tried searching for this problem but how do you describe it in search terms? I hope this rings a bell as I do not have a way to present a short code sample to reproduce it.

I have a windows form with several controls that I have placed on it with the Designer: a tool strip with several buttons, a status strip with some labels and buttons on it. At one point most controls disappeared off the Designer view, although they are still defined in the Designer code. The tool strip and the status strip were still there but they were empty - all buttons and labels were gone (or, should I say, not visible. It happened to me twice and the first time I was forced to clear all controls off the form and recreate them from scratch. I couldn't add them again as they already existed, so I had to do a "select all" and "delete". It is stupid: all controls are listed in the source code of the Designer but do not show up in Design view. I tried rebuilding, closing and reopening, even deleting some project files configuration (but not all as I'm not sure which does what). I think this might be happening when I copy and paste a button from another project. The design view still shows everything fine but when I run the program, the UI empty. Then after I close and reopen the Design view, the form is empty (which is why I did not know at exactly what point it happened).

This is very annoying as I now have a lot of work into this form and I don't want to lose it. Is this a know issue? Any suggestion as to how I can recover the control on the form, such as deleting some configuration files and rebuilding? I am using Visual Studio 2005 SP1, with C#. I used to have similar problems when I was working in managed C++ where if the form files were read only, it would not open at all in Design view but that was recoverable. I really need to figure this one out as I don't want to have to redo all the work and I want to know how and why this happens as I don't want to have to deal with it anymore. Any help would be appreciated.

Kamen
Using Visual Studio 2005 SP1; moving to C# from C++; and sticking to Windows XP. Mountain Time Zone.

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>