在TabControl中的TabPage选项卡中添加Form窗体
private void Home_Load(object sender, EventArgs e)
{
//this.tabPage1.Controls.Clear();
BiYiNiao byn = new BiYiNiao();
byn.FormBorderStyle = FormBorderStyle.None;
byn.TopLevel = false;
byn.Visible = true;
byn.Dock = DockStyle.Fill;
this.tabPage1.Controls.Add(byn);
byn.WindowState = FormWindowState.Maximized;//如果windowState设置为最大化,添加到tabPage中时,winform不会显示出来
byn.Show();
//this.tabPage2.Controls.Clear();
ShengChengTXT sctxt = new ShengChengTXT();
sctxt.FormBorderStyle = FormBorderStyle.None;
sctxt.TopLevel = false;
sctxt.Visible = true;
sctxt.Dock = DockStyle.Fill;
this.tabPage2.Controls.Add(sctxt);
sctxt.WindowState = FormWindowState.Maximized;//如果windowState设置为最大化,添加到tabPage中时,winform不会显示出来
sctxt.Show();
}