Windows Forms Application MDI

MDI


Multiple Document Interface

Form Design



Source Code


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 WindowsFormsApplication1
{
public partial class Form1 : Form
public Form1()
{
InitializeComponent();
}

private void redToolStripMenuItem_Click(object sender, EventArgs e)
{
frmRed red = new frmRed();
red.MdiParent = this;
red.Show();
}

private void greenToolStripMenuItem_Click(object sender, EventArgs e)
{
frmGreen green = new frmGreen();
green.MdiParent = this;
green.Show();
}

private void blueToolStripMenuItem_Click(object sender, EventArgs e)
{
frmBlue blue = new frmBlue();
blue.MdiParent = this;
blue.Show();
}

private void horizontalToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}

private void verticalToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}

private void tileToolStripMenuItem_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileHorizontal);
}

private void cascadeToolStripMenuItem1_Click(object sender, EventArgs e)
{
this.LayoutMdi(MdiLayout.TileVertical);
}

private void colorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
this.ActiveMdiChild.BackColor = colorDialog1.Color;
}

}
}

Output Screen


No comments:

Post a Comment

Techzmatrix