1、设置父窗体的IsMdiContainer = true;
2、代码:
frmtest childForm = new frmtest();
childForm.MdiParent = this;
childForm.WindowState = FormWindowState.Maximized;
childForm.ControlBox = false; //取消子窗体的最大化,最小化和还原按钮
childForm.Show();
3、设置MDI背景:
/// <summary>
/// 设置MDI背景
/// </summary>
void RemoveMdiBackColor()
{
foreach (Control c in this.Controls)
{
if (c is MdiClient)
{
c.BackColor = System.Drawing.Color.Aqua; //颜色
c.BackgroundImage = this.BackgroundImage;
this.IsMdiContainer//背景
}
}
}