且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将值从父窗体传递到子窗体

更新时间:2023-12-06 13:16:28

没有父母"和孩子"形式的关系,有所有者"和拥有"形式.如果需要应用程序完整性,则确实需要使用此关系.

对于传递和数据以及表格之间的任何合作,这种关系并不重要.它可以是同一程序集的任何形式.

我坚持使用基于表单之一实现的某些接口的我的"最健壮的方法.请看下面.有几种不同的方法.您可以在此讨论中找到所有内容:

如何在列表框之间复制所有项目两种形式 [ ^ ].

—SA
There is not "parent" and "child" form relationship, there is "Owner" and "Owned" forms. You really need to use this relationship if you need application integrity.

As to passing and data and any cooperation between forms, this relatioship just does not matter. It could be any forms of the same assembly.

I insist on using "my" most robust method based on some interface implemented on one of the form. Please see below. There are few different approached. You can find it all in this discussion:

How to copy all the items between listboxes in two forms[^].

—SA


选中此项.

在表单之间传递数据 [此处 [
Check this.

Passing Data Between Forms[^]

For more info here[^].