Creating an MDI Application in Microsoft Visual Studio 2013 |
|
Introduction
Microsoft Visual Studio 2013 make it very easy to start an MDI application. It doesn't do everything for you but it provides all the primary characteristics. It does this through the MDI Parent Form of the Add New Item dialog box.
Topic Applied: Creating an MDI Application in Microsoft Visual Studio |
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 Announce { public partial class ParentDocument : Form { private int childFormNumber = 1; public ParentDocument() { InitializeComponent(); ShowNewForm(null, null); } private void ShowNewForm(object sender, EventArgs e) { SampleDocument childForm = new SampleDocument(); childForm.MdiParent = this; childForm.Text = "Untitled " + childFormNumber++; childForm.Show(); } . . . No Change private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form childForm in MdiChildren) { childForm.Close(); } } [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new ParentDocument()); } } }
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 GreyViewer { public partial class Producer : Form { private int childFormNumber = 1; public Producer() { InitializeComponent(); } private void ShowNewForm(object sender, EventArgs e) { SingleView childForm = new SingleView(); childForm.MdiParent = this; childForm.Text = "Viewer " + childFormNumber++; childForm.Show(); } . . . No Change private void Producer_Load(object sender, EventArgs e) { ShowNewForm(sender, e); } } }
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Producer());
}