首先:创建父窗体 设置IsMdiContainer属性为true。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UsingMDI
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void visualC2010ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form child1 = new Form();
child1.MdiParent = this;
child1.Text = "窗体0";
child1.Show();
}
private void visualC2010ToolStripMenuItem1_Click(object sender, EventArgs e)
{
Form child2 = new Form();
child2.MdiParent = this;
child2.Text = "窗体1";
child2.Show();
}
private void cascadeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Layout

本文介绍了如何在C#中创建和设置MDI(多文档界面)父窗体,通过将IsMdiContainer属性设置为true,实现多子窗口的管理。
最低0.47元/天 解锁文章
856

被折叠的 条评论
为什么被折叠?



