Is recovery possible without recreation?!?

Linguinut

New member
Joined
Nov 14, 2006
Messages
2
Programming Experience
5-10
A couple of other members have submitted threads regarding the disappearance of controls from the UI design window. The control definitions are still in the code view. One person said that nearly a month's work was lost because of this little issue.

I have run into this problem for the third or fourth time (both web form and winform, and, VS.NET 2003 AND VS 2005!!). It ALWAYS comes at the worst possible point in the development process. I am not looking for anyone to tell me to rebuild or recreate the form--these "solutions" either do not work or the task is so daunting as to need a permanent prescription for Valium.

Is it possible to recover the form's missing controls without recreating the form? Just a 'yes' or 'no'. If 'yes', please explain.

I have a deep-seated inkling that the form is lost and the IDE is incapable of reconstructing the controls from it's own definitions. Sad. I am also losing many, many hours of productivity because of this "bug". By the way, Visual Source Safe is no help. My backup is useless, since so much has been done from the backup up to the "bug", that I may as well recreate the form from scratch. I must now resort to backups going on several times each day while I am working. That stinks.

Oh, well. It could be worse. My loss can be counted in hours. I really, really feel for those of you who have to count the loss in days.

Morals to be learned:
Backup frequently in order to continue moving forward.
Source control is not backup control.

Ling
 
I have never had this happen in VS2005, but it did happen while using VS2003. I believe the problem was my fault and that my code was flawed which caused the problems. I've since learned better techniques and this is probably why I haven't seen the problem in VS2005. It's probably a combination of that and the fact that VS2005 is a better environment.

Each time this happened to me in VS2003, the problem was that the controls that disappeared weren't being added to the Controls collection of the form. You can check for that in the InitializeComponent method which occurs in the designer generated code.

In my case, if the designer had added the controls to the control collection, there would have been much worse problems than the controls not being drawn.
 
This did happen a lot in 2003.

The controls are being added to the collection. They are not found in the component tray...they just disappear. Of course, properties are difficult to set and adding a new one breaks all kinds of continuity in the code.

I had to redo the form. I manually removed the object from the designer's collection, then readded them and manually walked through the scripts to make sure they fired ok.

Now, I am quite diligent about backing up the projects. Every day, of course, and whenever I have finished making large changes.

Thanks for your response. I am off to perform a backup.

Ling
 
Back
Top