Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
mdi表单-->&燃气轮机;子窗体1(按钮-->;>;子窗体2)c#来自其他子窗体按钮的子窗体_C#_.net_Oop_Mdi_Mdichild - Fatal编程技术网

mdi表单-->&燃气轮机;子窗体1(按钮-->;>;子窗体2)c#来自其他子窗体按钮的子窗体

mdi表单-->&燃气轮机;子窗体1(按钮-->;>;子窗体2)c#来自其他子窗体按钮的子窗体,c#,.net,oop,mdi,mdichild,C#,.net,Oop,Mdi,Mdichild,我有mdi表单“m1”,其中子表单中的OnLoad打开子表单“ch1”,我有一个按钮“b1”,它进一步打开新表单“ch2”,但该表单应该是“md1”ch2的子表单。MdiParent=this;由于子窗体2是由子窗体1创建的,因此它需要引用子窗体1的MDI父级,而不是此(不是MDI窗体): 请解释什么不起作用,展示一些代码,给我们一个帮助的机会;你写的东西对我们来说至少和你一样神秘..顺便说一句,我得到了ans谢谢你的关心,ans是//ch2.MdiParent=this;ch2.MdiPare

我有mdi表单“m1”,其中子表单中的OnLoad打开子表单“ch1”,我有一个按钮“b1”,它进一步打开新表单“ch2”,但该表单应该是“md1”ch2的子表单。MdiParent=this;由于子窗体2是由子窗体1创建的,因此它需要引用子窗体1的MDI父级,而不是
(不是MDI窗体):


请解释什么不起作用,展示一些代码,给我们一个帮助的机会;你写的东西对我们来说至少和你一样神秘..顺便说一句,我得到了ans谢谢你的关心,ans是//ch2.MdiParent=this;ch2.MdiParent=this.MdiParent;非常感谢。事实上,我想知道我如何才能收回子表单,例如如果ch2.Hide();将隐藏该表单我可以从其他表单中重新打开该表单吗?@AbhinavAggarwal如果您有该表单的引用,则可以。Student_Registration sr=null;private bool CheckOpened(字符串名称){FormCollection fc=Application.OpenForms;foreach(Form frm in fc){if(frm.Text==name){return true;}}return false;}private void aDDSTUDENTToolStripMenuItem_Click(对象发送者,事件参数e){if(sr==null | | | | sr.Text==“”){sr=new Student_Registration();sr.mdipent=this;sr.Dock=DockStyle.Fill;sr.Show()}else if(选中打开(sr.Text)){sr.WindowState=FormWindowState.Normal;sr.Dock=DockStyle.Fill;sr.Show();sr.Focus();}
ch2.MdiParent = this.MdiParent;