Set MdiParent
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());
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
|