Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.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
使用C#应用程序以编程方式级联窗口_C# - Fatal编程技术网

使用C#应用程序以编程方式级联窗口

使用C#应用程序以编程方式级联窗口,c#,C#,我正在编写c#应用程序我有一个父窗体,其他都是子窗体我想级联所有在父窗体中作为子窗体打开的窗口我如何级联窗口或关闭所有窗口或将其最小化我指的是可以调用窗体父窗体的子窗体功能。在MDI窗体上: using System.Windows.Forms; // cascade this.LayoutMdi(MdiLayout.Cascade); // close all Form[] children = this.MdiChildren; for (int i = 0; i < childr

我正在编写c#应用程序我有一个父窗体,其他都是子窗体我想级联所有在父窗体中作为子窗体打开的窗口我如何级联窗口或关闭所有窗口或将其最小化我指的是可以调用窗体父窗体的子窗体功能。

在MDI窗体上:

using System.Windows.Forms;

// cascade
this.LayoutMdi(MdiLayout.Cascade);

// close all
Form[] children = this.MdiChildren;
for (int i = 0; i < children.Length; i++) {
    children[i].Close();
}

// minimize all
foreach (Form child in this.MdiChildren) {
    child.WindowState = FormWindowState.Minimized;
}
使用System.Windows.Forms;
//级联
this.LayoutMdi(mdiloayout.Cascade);
//全部关闭
Form[]children=this.MdiChildren;
for(int i=0;i
在MDI表单上:

using System.Windows.Forms;

// cascade
this.LayoutMdi(MdiLayout.Cascade);

// close all
Form[] children = this.MdiChildren;
for (int i = 0; i < children.Length; i++) {
    children[i].Close();
}

// minimize all
foreach (Form child in this.MdiChildren) {
    child.WindowState = FormWindowState.Minimized;
}
使用System.Windows.Forms;
//级联
this.LayoutMdi(mdiloayout.Cascade);
//全部关闭
Form[]children=this.MdiChildren;
for(int i=0;i