:( ok this really scared me today, well about 5 minutes ago. Maybe someone can explain to me what happened and how it could be avoided. Thanks in advance.
Everything was working fine in the Win Form application which i am making in C#, under VS 2003. Net. The form is visually inheriting from a base form. Neways , i set the "WindowState" property to maximise, and ran the application. It caused an error since there was some code being executed in the OnSizeChanged event of the base form. Then all of a sudden all the controls on the derived form had disapeared :(.
Luckily i had backed up the entire project few minutes ago so i copied and pasted the designer code back in. So can anyone please tell me why does the code from the InitializeComponent() function get removed when there is an error either in the base form or the main.
Thanks.

Really horrible experience
Ellanna
Here is a better explanation.
" http://www.shawnburke.com/default.aspx document=183&userinterface=9
Shawn Burke
2/3/2005 1:41:48 PM
Lance -- actually that's a different issue. That was (stupid and wrong) design decision we made back early in the development of VS 2002. I remember talking about it but just can't believe we did that, you're complaining to the right guy, so my apologies there. Basically what's happening is that you rebuild. The build of the control fails. The designer in the other project can't know that, it just sees that the assembly that has the control is no longer valid. It asks the project system for the WindowsControlLibrary.UserControl1 type, and the project system says "sorry, don't have it." So the designer (and this was the mistake; we should have just failed the load right then and there) shrugs its shoulders, and goes about its business. The net result is that the control is just plain gone, and if you make a change and save, it's gone for good. If you see this happen, you need to close the designer, answer "NO" when it asks to save changes, fix your build problems, then reopen it, and you should be okay. In VS 2005 we do the *right* thing and fail the load with a "could not find type 'WindowsControlLibrary.UserControl1'.
"
mykes
erase_ego
Terry Smith
I hope that helps.
[1] http://www.shawnburke.com/default.aspx document=183&userinterface=9
[2] http://dotnetjunkies.com/WebLog/nenoloje/archive/2004/06/18/16952.aspx