Andrew,
This problem has been seen by a lot of folks including myself. Here are
some notes that I keep on the subject:
There is supposedly a fix from Microsoft (see Article 842706):
FIX: Controls disappear from the Windows Forms Designer in Visual Studio
..NET 2003
http://support.microsoft.com/default...B;EN-US;842706
Other Notes:
- Make sure the form's tab is not visible and move the forms constructor to
the very top of the form class. Yes, above the field declarations as well.
Afterwards, recompile the solution and view the form.
- If the control has never been compiled for either debug or release, make
sure that the from tab is not visible when you switch your build option from
debug to release or vice versa if the control has never been built for the
target build type. At any rate, rebuild the solution for the new target
build option and then you can open your form.
- It also seems like some folks don't take into consideration what custom
controls are doing at design time in the IDE and should consider using the
this.DesignMode property inside of constructors and paint methods to avoid
creating stuff and using objects that aren't really used at design time.
- To avoid having to retrieve code from source control to restore, consider
turning off the auto-save before building options (Tools->Options->Build and
Run options). Yes, you may have to manually save sometimes to see your
changes before building and running. Sometimes you don't...haven't figured
that one out.....
- Finally, the one that I have seen work a few times.... Open a form with
problems, move a few things around, close the form and DO NOT save, reopen
the form and the controls are back in place. Don't ask me why....Microsof t
has some bugs that I hope they have fixed in 2.0.
Have fun,
Dave