如何将datagridview值传递给c#.net中的另一种形式 [英] how to pass datagridview value to another form in c#.net

查看:152
本文介绍了如何将datagridview值传递给c#.net中的另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将datagridview值传递给c#.net中的另一个表单/文本框

how to pass datagridview value to another form/Textbox in c#.net

推荐答案

这是一个关于表单协作的流行问题.最健壮的方法是在表单类中实现适当的接口.

有关更多详细信息,请参见我过去的回答:
如何在列表框之间复制所有项目两种形式 [ ^ ].

另请参见整个讨论以了解不同的选择.

—SA
This is a popular question about form collaboration. Most robust way is implementing appropriate interface in the form class.

For more details, see my past answer:
How to copy all the items between listboxes in two forms[^].

See also the whole discussion for different options.

—SA


好吧,您可以使用构造函数来传递值,表单上的属性,也可以设置委托以在数据更改时传递消息.很难根据这个含糊的要求来精确.
Well, you can use a constructor to pass values, properties on the form, or you can set up delegates to pass messages as the data changes. Hard to be precise based on this vague request.


这篇关于如何将datagridview值传递给c#.net中的另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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