How C # TabControl components display a form
Title, that is, when you click on an item in the MENUSTRIP1 component or TOOLSTRIP1 component, no longer jumps out of the form and all appear in TabControl, the TabPage page header name is also the name of an item in the component, and the form is designed first. You need to turn the content into a label form, and the new form is displayed each time a new form is added, such as when the form is closed with the last open form.
C # code private void Button2_Click (object sender, EventArgs e) {bool has = false; foreach (TabPage A in tabcontrol1.tabpages) {if (A.name = = "KKK")//TABP Age name KKK {has = true; }} if (!have) {TabPage TabPageCity1 = new TabPage ("KKK"); Tabpagecity1.name = "KKK"; THIS.TABCONTROL1.TABPAGES.ADD (TabPageCity1); Formcity frmcity = new formcity (); Formcity:from frmcity.toplevel = false; Frmcity.parent = TabPageCity1; Frmcity.controlbox = false; Frmcity.dock = System.Windows.Forms.DockStyle.Fill; Frmcity.show (); This.tabControl1.SelectedTab = TabPageCity1; } else {MessageBox.Show ("CZ"); } }
Set FormBorderStyle to none there is no title bar