Reputation: 5066
I have a winform usercontrol with several items (textboxes, buttons,...). Now I am confronted with phenomenon, that all items are suddenly away (in the VS 2010 designer view / document outline), although in the control designer file (designer.cs) the textboxes, buttons,... are still defined. There is also no compilation error. When I run the application, the items are still missing! I have already restarted VS! Does anybody know, what the reason for this is?
Upvotes: 3
Views: 1728
Reputation: 128367
Did you possibly remove the call to InitializeComponent
from your control's constructor by accident?
Does the name of the partial class
in your .designer.cs file match that of your "main" control file?
Try running your application through VS's debugger. Put a breakpoint at InitializeComponent
and step through all the code responsible for creating and placing all the controls in your user control. Maybe you will happen upon an explanation this way.
Upvotes: 2
Reputation: 9936
In the InitializeComponent method do all the controls get added to the form via this.Controls.Add... statements?
I know this happened with VS2003 a lot that these code lines would disappear. I suspect that this is the problem
Upvotes: 6
Reputation: 4768
Try to restart your Visual Studio, and the do a Rebuild Solution.
Upvotes: 0