The use of WPF TabControl controls

Source: Internet
Author: User

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.Media.Imaging;usingSystem.Windows.Shapes;namespaceWPF controls are bound to each other {/// <summary>    ///the interactive logic of Window2.xaml/// </summary>     Public Partial classWindow2:window { PublicWindow2 () {InitializeComponent (); }        //When you click Open,        inti =0;        TabItem tab;        TextBox TB;              DataGrid DG; Private voidMenuitem_click_1 (Objectsender, RoutedEventArgs e) {tab=NewTabItem ();//Build Tabtab. Header ="New Window"+ (i+1);//Name of new tabTABCONTROL1.ITEMS.ADD (tab);//Tab CollectionTabcontrol1.selectedindex=i; TB=NewTextBox (); Tb. Width= $; Tb. Height= $; if(i==0) {tab. Content=TB; } tab. MouseDoubleClick+ = Tab_mousedoubleclick;//Double-click the Close tabI++; }        Private voidTab_mousedoubleclick (Objectsender, MouseButtonEventArgs e) {TabItem s=(TabItem) sender;        TabControl1.Items.Remove (s); }

The use of WPF TabControl controls

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.