// Sample
using System;
using System.Windows.Forms;
using System.Drawing;
public class Test
{
static void Main ()
{
TestForm form = new TestForm ();
Application.Run (form);
}
}
public class TestForm : Form
{
public TestForm ()
{
IsMdiContainer = true;
// Add an Mdi component
Form form = new Form ();
form.MdiParent = this;
form.Show ();
Button button = new Button ();
button.Text = "Click me!";
button.Location = new Point (5, 5);
button.Parent = form;
button.Click += delegate (object o, EventArgs args) {
IsMdiContainer = false; // This is the important line
//IsMdiContainer = true; // This is a funny line
};
}
}