如何将值从子窗体发送到父窗体 [英] How To Sent values from child form to parent form

查看:67
本文介绍了如何将值从子窗体发送到父窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个产品主数据表,我在产品主数据表上给出了一个命名产品列表的按钮,当我单击按钮时,将打开一个包含产品列表的新表格.
当我单击列表中的任何产品时,我想这样做,我想在放置产品列表按钮的产品主数据上打开该产品的所有详细信息

如何执行此操作....请帮助.

I have a form which is product master,i have given a button naming product list on the product master,when i click on button a new form is open containing list of products.
I am trying to do when i click on any product in the list,i want to open all details of that product on the product master where the product list button is placed

How to do this.... pls help.

推荐答案


请仔细阅读
子级到主窗口

问候
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[^][^]


这篇关于如何将值从子窗体发送到父窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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