且构网

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

如何将值从子窗体发送到父窗体

更新时间:2023-12-06 09:00:52


请仔细阅读
子级到主窗口

问候
AR
Hi
Please go through with this
Child to Main Window

Regards
AR


这是一个很普遍的问题.像大多数其他查询者一样,您也会犯相同的错误:表单之间没有父子关系,而Owner和OwnedForm.如果想要良好的UI完整性,则需要使用此关系.对于表单协作,这一点都没有关系.

像往常一样,到目前为止,尚未提到基于表单实现的接口的最可靠的方法.
请在这里查看我过去的答案和讨论:
如何在列表框之间复制所有项目两种形式 [ ^ ].

—SA
This is a popular question. Like most other Inquirers, you do the same mistake: there is no parent-child relationship between forms, there is Owner and OwnedForm. You need to use this relationship if you want good UI integrity. For form collaboration it does not matter at all though.

As usual, the most robust approach based on the interface implemented by the form is not mentioned so far.
Please see my past answer and discussion here:
How to copy all the items between listboxes in two forms[^].

—SA


查看此链接

^ ] [ ^ ]
see this link

Passing Values between Forms in .NET 1.x with C# and VB.NET examples[^][^]