在所有表单之间传递数据 [英] Passing data between all forms

查看:88
本文介绍了在所有表单之间传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有5个表单,我想从datagridview(单击单元格)到所有其他表单共享数据,但是当它们打开时,因为有一个特定的顺序要遵循。这可能吗?



我尝试过:



列出所有与

I have 5 forms, and I want to share data from the datagridview (when clicked on cell) through to all other forms but when they're opened as there is a specific order to be followed. Is this possible?

What I have tried:

listing all forms to be shared with

推荐答案

是 - 您通过主表单 - 导致其他表单打开的表单。

究竟如何取决于DataGridView的位置,但其中一个应该可以帮助您:

在两种表格之间传递信息,第1部分:父母对儿童 [ ^ ]

在两种形式之间传递信息,第2部分:儿童到父母 [ ^ ]

在两种表格之间传递信息,第3部分:儿童与儿童 [ ^ ]
Yes - you go via the "master" form - the one that causes the others to be opened.
Exactly how depends on where the DataGridView is, but one of these should help you:
Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]


请参见此处的示例:如何将数据格式视图值从form1传递到C#中的表单2 [ ^ ]

此示例适用于 BindingList 但你当然也可以使用其他变量......
See example here: How to pass datagridview values from form1 to form 2 in C#[^]
This example is for a BindingList but you can use other variables too of course ...


这篇关于在所有表单之间传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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