如何在两种表单之间传递数据 [英] How Do I Pass Data Between Two Forms

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

问题描述

我有2个表格。 form1和form2。 form2将作为向导工作。想法是让用户选择文件并让它加载到form1上,这是主要的。



form1这是我的主窗体(此窗体包含,文本框(用于文件路径),datgridview和浏览按钮,将文件加载到datgridview,工作正常)。现在我创建了另一个窗体(form2),它将打开,用户将从中浏览文件。该路径将显示在文本框中。用户点击完成按钮后。它必须关闭form2并打开form1并将文件加载到form1。



我如何存档?

解决方案

请参阅此处:在两个表单之间传输信息,第2部分:子项到家长 [ ^ ]

http://www.codeproject.com/Tips/548131/Transferring-information-between-two-forms-Part

I have 2 forms. form1 and form2. form2 will be working as a wizard.the idea is to let the user select the file and let it get loaded on form1 which is the main.

form1 it is my main form(this form contains, textbox(for file path),datgridview and browse button which loads the file to the datgridview which works fine). now i created anotherform(form2) which will open and the user will broswe the file from it.the path will be displayed on the textbox. After the user clicked finish button. it must close form2 and open form1 with the file being loaded to form1.

How can i archive this ?

解决方案

See here: Transferring information between two forms, Part 2: Child to Parent[^]


http://www.codeproject.com/Tips/548131/Transferring-information-between-two-forms-Part


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

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