Code/C#
[C#] MDI Sample
Hide Code
2009. 1. 5. 12:42
using System;
using System.Windows.Forms;
namespace MdiSample
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void menuItemNew_Click(object sender, EventArgs e)
{
FormChild newMDIChild = new FormChild();
newMDIChild.MdiParent = this; // Set the Parent Form
newMDIChild.Show(); // Display the new form
}
private void menuItemCascade_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.Cascade);
}
private void menuItemTileHorizontal_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}
private void menuItemTileVertical_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}
}
}
using System.Windows.Forms;
namespace MdiSample
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void menuItemNew_Click(object sender, EventArgs e)
{
FormChild newMDIChild = new FormChild();
newMDIChild.MdiParent = this; // Set the Parent Form
newMDIChild.Show(); // Display the new form
}
private void menuItemCascade_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.Cascade);
}
private void menuItemTileHorizontal_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}
private void menuItemTileVertical_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}
}
}