简体   繁体   English

将数据从MDI子级传递到MDI父级

[英]Passing data from MDI Child to MDI Parent

I new some help to pass data from my mdi child to the mdi parent. 我提供了一些帮助,以将数据从我的MDI子传递到MDI父。 And I want to show the string (on the mdi parent) that I wrote in the mdi child. 我想显示我在mdi子代中写的字符串(在mdi父代上)。 I also have to make the string appear after close the mdi child. 关闭mdi子项后,我还必须使字符串出现。

例

Any help? 有什么帮助吗?

您可以从父表单访问父表单我的名字

Form frm = (Form)Application.OpenForms["ParentFormName"];

Just declare a variable in parent with internal access and assign values of child form to that variable. 只需在具有内部访问权限的父对象中声明一个变量,然后将子窗体的值分配给该变量即可。 You should be good to use the value on parent form. 您最好在父表单上使用该值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM