Set MdiParent : MDI « GUI Windows Forms « C# / CSharp Tutorial






using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;



class frmContainer : Form {
    public frmContainer() {
        InitializeComponent();

        frmChild child = new frmChild(this);
        child.Show();
    }
    private void InitializeComponent() {
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(292, 273);
        this.IsMdiContainer = true;
        this.Name = "frmContainer";
        this.Text = "MDI Basic";
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;

    }
}

class frmChild : Form {
    public frmChild(frmContainer parent) {
        InitializeComponent();

        this.MdiParent = parent;
    }
    private void InitializeComponent() {
        this.Text = "frmChild";
    }
    [STAThread]
    static void Main() {
        Application.EnableVisualStyles();
        Application.Run(new frmContainer());
    }

}








23.6.MDI
23.6.1.Is a form Mdi Container
23.6.2.Set MdiParent
23.6.3.MDI children form backgroundMDI children form background
23.6.4.Arrange Child formArrange Child form