简体   繁体   English

C#修改的自定义控件不会在设计器中更新

[英]C# modified custom control wont update in designer

I created a control that inherits the TreeView control. 我创建了一个继承TreeView控件的控件。 In this new control I've added a property. 在这个新控件中,我添加了一个属性。 I've added this new control to my design just fine. 我已经将此新控件添加到我的设计中。 Everything works. 一切正常。 However, when I edit the code of this new control and build, it updates in the toolbox, but not in the design. 但是,当我编辑此新控件的代码并进行构建时,它会在工具箱中更新,而不会在设计中更新。 The only way I've found to update my design is to physically drag a new instance of the control into the designer and reconfigure it from scratch. 我发现更新设计的唯一方法是将控件的新实例物理地拖到设计器中,然后从头开始对其进行重新配置。 Is there a way to tell Visual Studio to update instances to match what is in the toolbox? 有没有办法告诉Visual Studio更新实例以匹配工具箱中的内容? I 一世

It will not be updated in the designer unless, you rebuild your project. 除非您重建项目,否则不会在设计器中对其进行更新。 Close the designer where it is hosted and re-open it after building. 关闭托管它的设计器,并在构建后重新打开它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM