多表格申请 [英] Multi Form Application

查看:77
本文介绍了多表格申请的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2017,C#,Winform多形式应用程序中工作。

I am working in VS2017, C#, Winform multiform application.

所以我有一个主表单FORM_A with 一个名为FORM_A_Button1的按钮。 它有一个名为FORM_A_ListView1的Listview

So I have a main form FORM_A with  a button called FORM_A_Button1.  And it has a Listview called FORM_A_ListView1

我有第二个表单(FORM_B),其中包含一个名为FORM_B_TextField1的文本字段和一个名为FORM_B_OK的按钮。

I have a second form (FORM_B) with a text field called FORM_B_TextField1 and a button called FORM_B_OK.

这就是我想要做的事情:

This is what I want to do:

1。点击  FORM_A_Button1 - >在FORM_A中,它将打开FORM_B(不关闭FORM_A)作为对话可能?)。

1. Click on FORM_A_Button1--> in FORM_A which will open the FORM_B (Without closing FORM_A) as a dialog Maybe?).

2。用户在  FORM_B_TextField1 中键入一些文字FORM_B

2. User type some text in FORM_B_TextField1  of FORM_B

3。用户点击  FORM_B_OK - >应该关闭FORM_B - >使用来自FORM_B的FORM_B_TextField1的文本值填充FORM_A_ListView1   无需刷新整个表单。

3. User click FORM_B_OK --> should close FORM_B-->Fill FORM_A_ListView1 with text value from FORM_B_TextField1 of FORM_B   without refreshing the entire form.

提前致谢。




推荐答案

简单。 只需让FORM_A_Button1创建新的FORM_B对象并调用ShowDialog。 当ShowDialog返回时,您可以在FORM_B中添加一个返回FORM_B_TextField1值的公共方法。
Easy.  Just have FORM_A_Button1 create the new FORM_B object and call ShowDialog.  When ShowDialog returns, you can add a public method in FORM_B that returns the FORM_B_TextField1 value.


这篇关于多表格申请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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