做MDI窗体首先你要将父窗体的IsMDIcontainer属性设为true;然后就是你的事件问题了!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinForm
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form1 form1 = new Form1();
form1.MdiParent = this;
form1.Show();
}
private void button2_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.MdiParent = this;
form2.Show();
}
}
}
当单击不同的按钮时就相识不同的窗体!