复制表格 [英] Copying a Form

查看:95
本文介绍了复制表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


是否有任何方法或方法将表单对象复制到变量?


我来解释一下 - 我们有一个名为复制的方法对于数据集类和&你们都必须知道下面两行代码之间有区别:

展开 | 选择 | Wrap | 行号

解决方案

默认情况下,.NET中的控件似乎不是Cloneable。

也许这篇文章可能会有所帮助吗?


感谢您的帮助 - 该文章确实帮助我探索了控件但同样没有申请窗体。


当我第一次使用VB.NET时,获得表单的唯一方法是首先定义它。例如,如果我设计了一个名为frmMenu的表单。我必须首先通过DIMM来创建它的实例。 dim myForm as new frmMenu然后我将不得不在我所有进一步的代码中使用myForm。现在看来你可以通过引用它们并让编译器自动创建一个新对象来使用你可以在VB6中返回的类。我相信如果你调暗类型的变量<你的表单类>使用上面的New关键字,您应该能够创建表单类的任意数量的对象,每个对象都有自己的属性集,可以独立于该表单类的任何其他对象进行更改。


Hi there,

Is there any method or a way to copy a form object to a variable?

Let me explain this - We have a method called "Copy" for the Dataset class & you all must be knowing that there is a difference between the below two lines of code:

Expand|Select|Wrap|Line Numbers

解决方案

Controls don''t seem to be Cloneable by default in .NET.
Perhaps this article may help?


Thanks for your help - that article did help me to explore about controls but the same doesn''t apply for windows forms.


When I first used VB.NET the only way you could get a form was to define it first. For example if I had designed a form with the name "frmMenu" I would have had to create an instance of it first by DIMming it first. "dim myForm as New frmMenu" Then I would have to use myForm in all my further code. Now it seems you can use the classes like you could back in VB6 by just referencing them and letting the compiler create a new object automatically.. I believe if you dim a variable of type <your form class> with the New keyword like above, you should be able to create any number of objects of your form class, each with it''s own set of properties that can be changed independent of any other object of that form class.


这篇关于复制表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆