How C # TabControl components Toggle Sample code that displays form forms

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.