c# winform中关于父窗体的一些子窗体布局的问题

2024-12-16 19:45:42
推荐回答(2个)
回答1:

最小化所有窗体好像可以通过遍历父窗体的子窗体,判断子窗体的窗体状态然后把之最小化

回答2:

private void 添加子窗体ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form ff = new Form();

ff.MdiParent = this;
ff.Show();
}

private void 垂直ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}

private void 水平ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}

private void 层叠ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.Cascade );
}