不知道这样是不是你要的:
code=C#]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class MDIParent1 : Form
{
private int childFormNumber = 0;
public MDIParent1()
{
InitializeComponent();
}
private void ShowNewForm(object sender, EventArgs e)
{
// Create a new instance of the child form.
Form childForm = new Form();
// Make it a child of this MDI form before showing it.
childForm.MdiParent = this;
childForm.Text = "Window " + childFormNumber++;
childForm.Show();
}