的WinForms用户控件现象:突然间所有的项目了! [英] Winforms usercontrol phenomenon : suddenly all items are away!
问题描述
我有一个的WinForm用户控件的几个项目(文本框,按钮,...)。现在我面临着现象,所有的项目都是忽远(在 VS 2010 设计器视图/文档大纲),虽然在控件设计文件(设计师的.cs )的文本框,按钮,...仍在定义。也没有编译错误。当我运行应用程序,该项目仍然下落不明!我已经重新启动VS! 是否有人知道,是什么这样做的原因是?
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?
推荐答案
在InitializeComponent方法做的所有控件被添加到通过this.Controls.Add形式...语句?
In the InitializeComponent method do all the controls get added to the form via this.Controls.Add... statements?
我知道这事与VS2003很多,这些code线将消失。我怀疑这就是问题所在。
I know this happened with VS2003 a lot that these code lines would disappear. I suspect that this is the problem
这篇关于的WinForms用户控件现象:突然间所有的项目了!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!