private void tabContro1_Selected(object sender, TabControlEventArgs e) { if (e.TabPage == tabPage3) { CarForm carForm = new CarForm(); carForm.FormBorderStyle = FormBorderStyle.None; carForm.TopLevel = false; //指示子窗体非顶级窗体 this.carPannel.Controls.Add(carForm); //将子窗体载入panel carForm.Dock = DockStyle.Fill; carForm.Show(); } if (e.TabPage == tabPage4) { CustomerInfo customerInfoForm = new CustomerInfo(); customerInfoForm.FormBorderStyle = FormBorderStyle.None; customerInfoForm.TopLevel = false; //指示子窗体非顶级窗体 this.cusomterInfoPannel.Controls.Add(customerInfoForm); //将子窗体载入panel customerInfoForm.Dock = DockStyle.Fill; customerInfoForm.Show(); } if (e.TabPage == tabPage5) { CarRequirementMamage carRequirementMamageForm = new CarRequirementMamage(); carRequirementMamageForm.FormBorderStyle = FormBorderStyle.None; carRequirementMamageForm.TopLevel = false; //指示子窗体非顶级窗体 this.carRequirementMamageFormpanel.Controls.Add(carRequirementMamageForm); //将子窗体载入panel carRequirementMamageFormpanel.Dock = DockStyle.Fill; carRequirementMamageForm.Show(); } if (e.TabPage == tabPage7) { summaryForm.FormBorderStyle = FormBorderStyle.None; summaryForm.TopLevel = false; //指示子窗体非顶级窗体 this.panel2.Controls.Add(summaryForm); //将子窗体载入panel carRequirementMamageFormpanel.Dock = DockStyle.Fill; summaryForm.Show(); } }
private void tabContro1_Selected(object sender, TabControlEventArgs e) { if (e.TabPage == tabPage3) { CarForm carForm = new CarForm(); carForm.FormBorderStyle = FormBorderStyle.None; carForm.TopLevel = false; //指示子窗体非顶级窗体 this.carPannel.Controls.Add(carForm);//将子窗体载入panel carForm.Dock = DockStyle.Fill; carForm.Show(); } if (e.TabPage == tabPage4) { CustomerInfo customerInfoForm = new CustomerInfo(); customerInfoForm.FormBorderStyle = FormBorderStyle.None; customerInfoForm.TopLevel = false; //指示子窗体非顶级窗体 this.cusomterInfoPannel.Controls.Add(customerInfoForm);//将子窗体载入panel customerInfoForm.Dock = DockStyle.Fill; customerInfoForm.Show(); } if (e.TabPage == tabPage5) { CarRequirementMamage carRequirementMamageForm = new CarRequirementMamage(); carRequirementMamageForm.FormBorderStyle = FormBorderStyle.None; carRequirementMamageForm.TopLevel = false; //指示子窗体非顶级窗体 this.carRequirementMamageFormpanel.Controls.Add(carRequirementMamageForm);//将子窗体载入panel carRequirementMamageFormpanel.Dock = DockStyle.Fill; carRequirementMamageForm.Show(); } if (e.TabPage == tabPage7) { summaryForm.FormBorderStyle = FormBorderStyle.None; summaryForm.TopLevel = false; //指示子窗体非顶级窗体 this.panel2.Controls.Add(summaryForm);//将子窗体载入panel carRequirementMamageFormpanel.Dock = DockStyle.Fill; summaryForm.Show(); } }