385 references to TabPages
System.Windows.Forms (23)
System\Windows\Forms\Controls\TabControl\TabControl.cs (11)
18[DefaultProperty(nameof(TabPages))] 479foreach (TabPage tabPage in TabPages) 982if (index >= 0 && index < TabPages.Count - 1) 1011TabPage tabPage = TabPages[tabPageName]!; 1267foreach (TabPage page in TabPages) 1553TabPages.Add(tabPages[i]); 1686TabPage tabPage = TabPages[tabPageName]!; 1780if (TabPages is not null) 1782s += $", TabPages.Count: {TabPages.Count}"; 1783if (TabPages.Count > 0) 1785s += $", TabPages[0]: {TabPages[0]}";
System\Windows\Forms\Controls\TabControl\TabControl.TabControlAccessibleObject.cs (8)
47|| owner.TabPages.Count == 0 49|| index > owner.TabPages.Count) 56: owner.TabPages[index - 1].TabAccessibilityObject; 73if (owner.TabPages.Count == 0) 80return owner.TabPages.Count + 1; 97foreach (TabPage tabPage in owner.TabPages) 121NavigateDirection.NavigateDirection_LastChild => owner.TabPages.Count > 0 122? owner.TabPages[^1].TabAccessibilityObject
System\Windows\Forms\Controls\TabControl\TabPage.cs (1)
167int currentIndex = tabControl.TabPages.IndexOf(this);
System\Windows\Forms\Controls\TabControl\TabPage.TabAccessibleObject.cs (1)
76private int CurrentIndex => OwningTabControl?.TabPages.IndexOf(_owningTabPage) ?? -1;
System\Windows\Forms\Controls\TabControl\TabPage.TabPageAccessibleObject.cs (2)
89return OwningTabControl.TabPages.Count > 0 ? OwningTabControl.TabPages[0].TabAccessibilityObject : null;
System.Windows.Forms.Design (7)
System\Drawing\Design\ColorEditor.ColorUI.cs (6)
169_tabControl.TabPages.Add(_paletteTabPage); 170_tabControl.TabPages.Add(_commonTabPage); 171_tabControl.TabPages.Add(_systemTabPage); 309Rectangle rectTabControl = _tabControl.TabPages[0].ClientRectangle; 345int count = _tabControl.TabPages.Count; 347_tabControl.SelectedTab = _tabControl.TabPages[sel];
System\Windows\Forms\Design\TabControlDesigner.cs (1)
326if (tc is null || tc.TabPages.Count == 0)
System.Windows.Forms.Design.Tests (6)
System\Windows\Forms\Design\TabControlDesignerTests.cs (5)
46tabControl.TabPages.Add(tabPage); 51tabControl.TabPages.Count.Should().Be(1); 69tabControl.TabPages.Add(tabPage); 101tabControl.TabPages.Add(tabPage); 149tabControl.TabPages.Add(tabPage);
System\Windows\Forms\Design\TabPageDesignerTests.cs (1)
54tabControl.TabPages.Add(tabPage);
System.Windows.Forms.Tests (336)
System\Windows\Forms\AccessibleObjects\TabControl.TabControlAccessibleObjectTests.cs (16)
161TabPageCollection pages = tabControl.TabPages; 177TabPageCollection pages = tabControl.TabPages; 214TabPageCollection pages = tabControl.TabPages; 235TabPageCollection pages = tabControl.TabPages; 260TabPageCollection pages = tabControl.TabPages; 275TabPageCollection pages = tabControl.TabPages; 288TabPageCollection pages = tabControl.TabPages; 306TabPageCollection pages = tabControl.TabPages; 324TabPageCollection pages = tabControl.TabPages; 342TabPageCollection pages = tabControl.TabPages; 371TabPageCollection pages = tabControl.TabPages; 387TabPageCollection pages = tabControl.TabPages; 406TabPageCollection pages = tabControl.TabPages; 426TabPageCollection pages = tabControl.TabPages; 454TabPageCollection pages = tabControl.TabPages; 477TabPageCollection pages = tabControl.TabPages;
System\Windows\Forms\AccessibleObjects\TabPage.TabAccessibleObjectTests.cs (55)
18TabPageCollection pages = tabControl.TabPages; 58TabPageCollection pages = tabControl.TabPages; 72TabPageCollection pages = tabControl.TabPages; 86TabPageCollection pages = tabControl.TabPages; 103TabPageCollection pages = tabControl.TabPages; 126TabPageCollection pages = tabControl.TabPages; 144TabPageCollection pages = tabControl.TabPages; 158TabPageCollection pages = tabControl.TabPages; 172TabPageCollection pages = tabControl.TabPages; 198TabPageCollection pages = tabControl.TabPages; 213TabPageCollection pages = tabControl.TabPages; 234TabPageCollection pages = tabControl.TabPages; 261TabPageCollection pages = tabControl.TabPages; 275TabPageCollection pages = tabControl.TabPages; 289TabPageCollection pages = tabControl.TabPages; 303TabPageCollection pages = tabControl.TabPages; 317TabPageCollection pages = tabControl.TabPages; 331TabPageCollection pages = tabControl.TabPages; 345TabPageCollection pages = tabControl.TabPages; 365TabPageCollection pages = tabControl.TabPages; 384TabPageCollection pages = tabControl.TabPages; 404TabPageCollection pages = tabControl.TabPages; 424TabPageCollection pages = tabControl.TabPages; 443TabPageCollection pages = tabControl.TabPages; 463TabPageCollection pages = tabControl.TabPages; 483TabPageCollection pages = tabControl.TabPages; 502TabPageCollection pages = tabControl.TabPages; 524TabPageCollection pages = tabControl.TabPages; 550TabPageCollection pages = tabControl.TabPages; 570TabPageCollection pages = tabControl.TabPages; 593TabPageCollection pages = tabControl.TabPages; 612TabPageCollection pages = tabControl.TabPages; 635TabPageCollection pages = tabControl.TabPages; 657TabPageCollection pages = tabControl.TabPages; 679TabPageCollection pages = tabControl.TabPages; 701TabPageCollection pages = tabControl.TabPages; 724TabPageCollection pages = tabControl.TabPages; 744TabPageCollection pages = tabControl.TabPages; 766TabPageCollection pages = tabControl.TabPages; 789TabPageCollection pages = tabControl.TabPages; 809TabPageCollection pages = tabControl.TabPages; 831TabPageCollection pages = tabControl.TabPages; 851TabPageCollection pages = tabControl.TabPages; 871TabPageCollection pages = tabControl.TabPages; 894TabPageCollection pages = tabControl.TabPages; 914TabPageCollection pages = tabControl.TabPages; 936TabPageCollection pages = tabControl.TabPages; 960TabPageCollection pages = tabControl.TabPages; 983TabPageCollection pages = tabControl.TabPages; 1003TabPageCollection pages = tabControl.TabPages; 1027TabPageCollection pages = tabControl.TabPages; 1051TabPageCollection pages = tabControl.TabPages; 1081TabPageCollection pages = tabControl.TabPages; 1096TabPageCollection pages = tabControl.TabPages; 1111TabPageCollection pages = tabControl.TabPages;
System\Windows\Forms\AccessibleObjects\TabPage.TabPageAccessibleObjectTests.cs (5)
206TabPageCollection pages = tabControl.TabPages; 225TabPageCollection pages = tabControl.TabPages; 243TabPageCollection pages = tabControl.TabPages; 265TabPageCollection pages = tabControl.TabPages; 413TabPageCollection pages = tabControl.TabPages;
System\Windows\Forms\TabControl.ControlCollectionTests.cs (27)
69Assert.Same(value1, Assert.Single(owner.TabPages)); 87Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 115Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 199Assert.Same(value1, Assert.Single(owner.TabPages)); 226Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 267Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 366Assert.Same(value1, Assert.Single(owner.TabPages)); 387Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 421Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 514Assert.Same(value1, Assert.Single(owner.TabPages)); 544Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 591Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 742Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 922Assert.Same(value1, Assert.Single(owner.TabPages)); 942Assert.Same(value1, Assert.Single(owner.TabPages)); 962Assert.Empty(owner.TabPages); 1034Assert.Same(value1, Assert.Single(owner.TabPages)); 1057Assert.Same(value1, Assert.Single(owner.TabPages)); 1083Assert.Empty(owner.TabPages); 1152Assert.Same(value1, Assert.Single(owner.TabPages)); 1175Assert.Same(value1, Assert.Single(owner.TabPages)); 1198Assert.Empty(owner.TabPages); 1271Assert.Same(value1, Assert.Single(owner.TabPages)); 1294Assert.Same(value1, Assert.Single(owner.TabPages)); 1320Assert.Empty(owner.TabPages); 1437Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 1446Assert.Equal(items, owner.TabPages.Cast<TabPage>());
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (75)
54Assert.Same(value1, Assert.Single(owner.TabPages)); 73Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 102Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 187Assert.Same(value1, Assert.Single(owner.TabPages)); 215Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 257Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 357Assert.Same(value1, Assert.Single(owner.TabPages)); 379Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 414Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 508Assert.Same(value1, Assert.Single(owner.TabPages)); 539Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 587Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 745Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 1002Assert.Same(value1, Assert.Single(owner.TabPages)); 1020Assert.Equal(new TabPage[] { value1, value2 }, owner.TabPages.Cast<TabPage>()); 1048Assert.Equal(new TabPage[] { value1, value2, value1 }, owner.TabPages.Cast<TabPage>()); 1311Assert.Empty(owner.TabPages); 1320Assert.Empty(owner.TabPages); 1362Assert.Empty(owner.TabPages); 1377Assert.Empty(owner.TabPages); 1418Assert.Empty(owner.TabPages); 1430Assert.Empty(owner.TabPages); 1483Assert.Empty(owner.TabPages); 1501Assert.Empty(owner.TabPages); 1996Assert.Same(value1, Assert.Single(owner.TabPages)); 2015Assert.Equal(new TabPage[] { value2, value1 }, owner.TabPages.Cast<TabPage>()); 2046Assert.Equal(new TabPage[] { value2, value1, value1 }, owner.TabPages.Cast<TabPage>()); 2124Assert.Same(value1, Assert.Single(owner.TabPages)); 2152Assert.Equal(new TabPage[] { value2, value1 }, owner.TabPages.Cast<TabPage>()); 2196Assert.Equal(new TabPage[] { value2, value1, value1 }, owner.TabPages.Cast<TabPage>()); 2300Assert.Same(value1, Assert.Single(owner.TabPages)); 2322Assert.Equal(new TabPage[] { value2, value1 }, owner.TabPages.Cast<TabPage>()); 2359Assert.Equal(new TabPage[] { value2, value1, value1 }, owner.TabPages.Cast<TabPage>()); 2457Assert.Same(value1, Assert.Single(owner.TabPages)); 2488Assert.Equal(new TabPage[] { value2, value1 }, owner.TabPages.Cast<TabPage>()); 2538Assert.Equal(new TabPage[] { value2, value1, value1 }, owner.TabPages.Cast<TabPage>()); 2695Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 3042Assert.Same(value1, Assert.Single(owner.TabPages)); 3061Assert.Equal(new TabPage[] { value2, value1 }, owner.TabPages.Cast<TabPage>()); 3092Assert.Equal(new TabPage[] { value2, value1, value1 }, owner.TabPages.Cast<TabPage>()); 4008Assert.Same(value1, Assert.Single(owner.TabPages)); 4029Assert.Same(value1, Assert.Single(owner.TabPages)); 4050Assert.Empty(owner.TabPages); 4123Assert.Same(value1, Assert.Single(owner.TabPages)); 4147Assert.Same(value1, Assert.Single(owner.TabPages)); 4174Assert.Empty(owner.TabPages); 4246Assert.Same(value1, Assert.Single(owner.TabPages)); 4270Assert.Same(value1, Assert.Single(owner.TabPages)); 4294Assert.Empty(owner.TabPages); 4370Assert.Same(value1, Assert.Single(owner.TabPages)); 4394Assert.Same(value1, Assert.Single(owner.TabPages)); 4421Assert.Empty(owner.TabPages); 4543Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 4552Assert.Equal(items, owner.TabPages.Cast<TabPage>()); 4728Assert.Same(value1, Assert.Single(owner.TabPages)); 4748Assert.Same(value1, Assert.Single(owner.TabPages)); 4768Assert.Empty(owner.TabPages); 5008TabControl.TabPages.Add(page1); 5011TabControl.TabPages.Insert(1, page2); 5012Assert.Equal(2, TabControl.TabPages.Count); 5013Assert.Equal(page2, TabControl.TabPages[1]); 5017TabControl.TabPages.Insert(1, page3); 5018Assert.Equal(3, TabControl.TabPages.Count); 5019Assert.Equal(page3, TabControl.TabPages[1]); 5021Assert.Equal(page2, TabControl.TabPages[2]); 5035TabControl.TabPages.Insert(0, page1); 5036Assert.Single(TabControl.TabPages); 5037Assert.Equal(page1, TabControl.TabPages[0]); 5041TabControl.TabPages.Insert(1, page2); 5042Assert.Equal(2, TabControl.TabPages.Count); 5043Assert.Equal(page2, TabControl.TabPages[1]); 5047TabControl.TabPages.Insert(1, page3); 5048Assert.Equal(3, TabControl.TabPages.Count); 5049Assert.Equal(page3, TabControl.TabPages[1]); 5051Assert.Equal(page2, TabControl.TabPages[2]);
System\Windows\Forms\TabControlTests.cs (131)
104Assert.Empty(control.TabPages); 105Assert.Same(control.TabPages, control.TabPages); 1052control.TabPages.Add(page1); 1053control.TabPages.Add(page2); 1054control.TabPages.Add(page3); 1261control.TabPages.Add(page1); 1262control.TabPages.Add(page2); 1457control.TabPages.Add(page1); 1458control.TabPages.Add(page2); 2018control.TabPages.Add(page1); 2019control.TabPages.Add(page2); 2053control.TabPages.Add(page1); 2054control.TabPages.Add(page2); 2058Assert.Equal(value < 0 || value >= control.TabPages.Count ? null : control.TabPages[value], control.SelectedTab); 2068Assert.Equal(value < 0 || value >= control.TabPages.Count ? null : control.TabPages[value], control.SelectedTab); 2120control.TabPages.Add(page1); 2121control.TabPages.Add(page2); 2132Assert.Equal(expected == -1 ? null : control.TabPages[expected], control.SelectedTab); 2134Assert.Equal(expectedVisible, control.TabPages.Cast<TabPage>().Select(p => p.Visible)); 2142Assert.Equal(expected == -1 ? null : control.TabPages[expected], control.SelectedTab); 2143Assert.Equal(expectedVisible, control.TabPages.Cast<TabPage>().Select(p => p.Visible)); 2524control.TabPages.Add(page1); 2525control.TabPages.Add(page2); 2544Assert.Empty(control.TabPages); 2580control.TabPages.Add(page1); 2581control.TabPages.Add(page2); 2672control.TabPages.Add(page1); 2673control.TabPages.Add(page2); 3017control.TabPages.Add(page1); 3018control.TabPages.Add(page2); 3068control.TabPages.Add(page1); 3069control.TabPages.Add(page2); 3185control.TabPages.Add(page1); 3186control.TabPages.Add(page2); 3202control.TabPages.Add(page1); 3203control.TabPages.Add(page2); 3259control.TabPages.Add(page1); 3260control.TabPages.Add(page2); 3385control.TabPages.Add(page1); 3386control.TabPages.Add(page2); 3396control.TabPages.Add(page1); 3397control.TabPages.Add(page2); 3447control.TabPages.Add(page1); 3448control.TabPages.Add(page2); 3568control.TabPages.Add(page1); 3569control.TabPages.Add(page2); 3620control.TabPages.Add(page1); 3621control.TabPages.Add(page2); 3622Assert.Same(control.TabPages[index], control.GetControl(index)); 3645control.TabPages.Add(page1); 3646control.TabPages.Add(page2); 3656control.TabPages.Add(page1); 3657control.TabPages.Add(page2); 3681control.TabPages.Add(page1); 3682control.TabPages.Add(page2); 3725control.TabPages.Add(page); 3754control.TabPages.Add(page); 3793control.TabPages.Add(page1); 3814control.TabPages.Add(page1); 3844control.TabPages.Add(page1); 3845control.TabPages.Add(page2); 3872control.TabPages.Add(page1); 3873control.TabPages.Add(page2); 3885control.TabPages.Add(page); 3912control.TabPages.Add(page1); 3913control.TabPages.Add(page2); 3923control.TabPages.Add(page1); 3924control.TabPages.Add(page2); 4144control.TabPages.Add(page1); 4145control.TabPages.Add(page2); 4280control.TabPages.Add(page1); 4281control.TabPages.Add(page2); 4455control.TabPages.Add(page1); 4456control.TabPages.Add(page2); 4618control.TabPages.Add(page1); 4619control.TabPages.Add(page2); 4693control.TabPages.Add(page1); 4694control.TabPages.Add(page2); 4774control.TabPages.Add(page1); 4775control.TabPages.Add(page2); 4857Assert.Empty(control.TabPages); 4865Assert.Empty(control.TabPages); 4874Assert.Empty(control.TabPages); 4884control.TabPages.Add(page1); 4885control.TabPages.Add(page2); 4890Assert.Equal(new TabPage[] { page1, page2 }, control.TabPages.Cast<TabPage>()); 4898Assert.Equal(new TabPage[] { page1, page2 }, control.TabPages.Cast<TabPage>()); 4907Assert.Equal(new TabPage[] { page1, page2 }, control.TabPages.Cast<TabPage>()); 4926control.TabPages.Add(page1); 4927control.TabPages.Add(page2); 4928control.TabPages.Add(page3); 4978Assert.Empty(control.TabPages); 4986Assert.Empty(control.TabPages); 5005control.TabPages.Add(child1); 5006control.TabPages.Add(child2); 5007control.TabPages.Add(child3); 5024Assert.Empty(control.TabPages); 5038Assert.Empty(control.TabPages); 5077Assert.Empty(control.TabPages); 5088Assert.Empty(control.TabPages); 5110control.TabPages.Add(child1); 5111control.TabPages.Add(child2); 5112control.TabPages.Add(child3); 5137Assert.Empty(control.TabPages); 5154Assert.Empty(control.TabPages); 5182control.TabPages.Add(child1); 5183control.TabPages.Add(child2); 5184control.TabPages.Add(child3); 5197control.TabPages.Add(page1); 5198control.TabPages.Add(page2); 5237control.TabPages.Add(page1); 5238control.TabPages.Add(page2); 5341control.TabPages.Add(page1); 5342control.TabPages.Add(page2); 5358control.TabPages.Add(page1); 5359control.TabPages.Add(page2); 5404control.TabPages.Add(page1); 5405control.TabPages.Add(page2); 5511control.TabPages.Add(page1); 5512control.TabPages.Add(page2); 5522control.TabPages.Add(page1); 5523control.TabPages.Add(page2); 5562control.TabPages.Add(page1); 5563control.TabPages.Add(page2); 5663control.TabPages.Add(page1); 5664control.TabPages.Add(page2); 5681control.TabPages.Add(page1); 5682control.TabPages.Add(page2);
System\Windows\Forms\TabPageTests.cs (27)
1379owner.TabPages.Add(page1); 1380owner.TabPages.Add(page2); 1381owner.TabPages.Add(page3); 1446owner.TabPages.Add(page1); 1447owner.TabPages.Add(page2); 1448owner.TabPages.Add(page3); 1754owner.TabPages.Add(page1); 1755owner.TabPages.Add(page2); 1756owner.TabPages.Add(page3); 1818owner.TabPages.Add(page1); 1819owner.TabPages.Add(page2); 1820owner.TabPages.Add(page3); 3010owner.TabPages.Add(page1); 3011owner.TabPages.Add(page2); 3012owner.TabPages.Add(page3); 3077owner.TabPages.Add(page1); 3078owner.TabPages.Add(page2); 3079owner.TabPages.Add(page3); 3383owner.TabPages.Add(page1); 3384owner.TabPages.Add(page2); 3385owner.TabPages.Add(page3); 3447owner.TabPages.Add(page1); 3448owner.TabPages.Add(page2); 3449owner.TabPages.Add(page3); 4964tabControl.TabPages.Add(new TabPage()); 4967TabPage testedTab = tabControl.TabPages[index]; 5032tabControl.TabPages.Add(page);
System.Windows.Forms.UI.IntegrationTests (13)
TabControlTests.cs (13)
72bool resultOfPage1 = ((IKeyboardToolTip)tabControl.TabPages[0]).IsHoveredWithMouse(); 73bool resultOfPage2 = ((IKeyboardToolTip)tabControl.TabPages[1]).IsHoveredWithMouse(); 90tabControl.TabPages.Add(tabPage1); 91tabControl.TabPages.Add(tabPage2); 104var originalPages = tabControl.TabPages.Cast<TabPage>().ToArray(); 118Assert.Equal(tabControl.Controls[i], tabControl.TabPages[i]); 124tabControl.TabPages.RemoveAt(0); 128Assert.Equal(originalPages[1], tabControl.TabPages[0]); 129Assert.Equal(originalPages[2], tabControl.TabPages[1]); 142tabControl.TabPages.Add(tabPage1); 143tabControl.TabPages.Add(tabPage2); 144tabControl.TabPages.Add(tabPage3); 147tabControl.SelectedIndex = tabControl.TabPages.Count - 1;