将数据从一个窗口传输到另一个窗口 [英] Transmitting data from one window to another

查看:133
本文介绍了将数据从一个窗口传输到另一个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Microsoft Access作为数据库的程序.我没有程序的源代码.我想在同一数据库结构的C#中创建一个新程序.

问题如下.是当铺的程序,管理一些合同.对于每个客户,都有一个有效或封闭合同的窗口.

要双击datagrid中的记录,请打开另一个窗口,其中在合同上可用的另一个datagrid中显示产品(1、2 ... x个产品),每个记录都有一个ckeckbox.

选定的产品(checkbox = true)是客户退回的产品,而ceckbox = false的产品是扩展的产品.
单击下一步",打开另一个带有两个DataGrid的窗口,一个带有客户端的数据网格接收产品,另一个带有扩展的产品.

问题.
如何在对应的datagrid中的下一个窗口中发送选择/取消选择的网格的行?

I have a program that uses Microsoft Access as the database. I don''t have the source code of program. I want to make a new program in C # on the same database structure.

The problem is the following. Is a program for a pawnshop, that manages some contracts. For each client is a window of active or closed contracts.

To double-click on the record in datagrid, open another window where products are displayed in another datagrid available on the contract (1, 2 ... x products), each record having a ckeckbox.

Selected products (checkbox = true) are products that the customer gets back, and those with ceckbox = false are products that extend.
Click Next, open another window with two DataGrid, a datagrid with client receives the products back, and one with products that extend.

Question.
How do I send rows selected / deselected the grid on the next window in the corresponding datagrid?

推荐答案


选中此选项将为您提供想法
如何将值从子窗体传递到父窗体 [ ^ ]
最好的问候
M.Mitwalli
Hi ,
Check this it will give you idea
how to pass values from child form to parent form[^]
Best Regards
M.Mitwalli


这是有关表单协作的流行问题.最健壮的解决方案是在Form类中实现适当的接口,并传递接口引用而不是对Form的整个实例"的引用.请查看我过去的解决方案以获取更多详细信息:如何以两种形式在列表框之间复制所有项目 [ http://en.wikipedia.org/wiki/Accidental_complexity [ http://en.wikipedia.org/wiki/Loose_coupling [
This is the popular question about form collaboration. The most robust solution is implementation of an appropriate interface in form class and passing the interface reference instead of reference to a "whole instance" of a Form. Please see my past solution for more detail: How to copy all the items between listboxes in two forms[^].

Please also see other solutions in this discussion. If the application is simple enough, the solution could be as simple as declaring of some internal property in one form and passing a reference to the instance of one form to the instance of another form. For more complex projects, such violation of strictly encapsulated style and loose coupling could add up the the accidental complexity of the code and invite mistakes, so the well-encapsulated solution would be preferable.

Please see also:
http://en.wikipedia.org/wiki/Accidental_complexity[^],
http://en.wikipedia.org/wiki/Loose_coupling[^].

—SA


这篇关于将数据从一个窗口传输到另一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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