简体   繁体   English

将控件从一种形式复制到另一种形式

[英]Copy controls from one form to another

I have many labels and text boxes on a form. 我在表单上有很多标签和文本框。 They're all lined up great and named. 他们都被列为伟大和命名。 Is it safe for me to copy all these controls to another form and rename them? 对我来说,将所有这些控件都复制到另一个表单并重命名它们是否安全? I want to be able to preserve their sizes and locations on the new form which is why I want to use the originals. 我希望能够在新表格上保留其大小和位置,这就是为什么要使用原始表格的原因。 I do not have any code yet in the original text boxes so that is not important. 我在原始文本框中还没有任何代码,所以这并不重要。 Thanks 谢谢

Yes it is safe. 是的,这很安全。

However, using usercontrols is usually a better way to use controls multiple times (You should not break the DRY rule). 但是,使用用户控件通常是多次使用控件的更好方法(您不应违反DRY规则)。

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

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