示例#1
0
        private void AddTab2()
        {
            var tab = new TabClass2()
            {
                TabName = "Tab class 2, with a long name", MyStringContent = "Try drag the tab outside the bonds of the tab control", MyNumberCollection = new int[] { 1, 2, 3, 4, }, MySelectedNumber = 1
            };

            //Simply adding items to the collection adds a tab
            this.ItemCollection.Add(tab);
            //and setting SelectedTab to it, will select it.
            this.SelectedTab = tab;
        }
 private void AddTab2()
 {
     var tab = new TabClass2() { TabName = "Tab class 2, with a long name", MyStringContent = "Try drag the tab outside the bonds of the tab control", MyNumberCollection = new int[] { 1, 2, 3, 4, }, MySelectedNumber = 1 };
     //Simply adding items to the collection adds a tab
     this.ItemCollection.Add(tab);
     //and setting SelectedTab to it, will select it.
     this.SelectedTab = tab;
 }