232 references to Items
Accessibility_Core_App (2)
CommonControl1.Designer.cs (2)
320this.comboBox2.Items.AddRange(new object[] { 345this.comboBox1.Items.AddRange(new object[] {
DesignSurface (1)
MainForm.cs (1)
201cb1.Items.AddRange(new string[] { "a1", "b2", "c3" });
PresentationUI (12)
MS\Internal\Documents\RequestedSignatureDialog.cs (6)
134_intentComboBox.Items.Add(SR.DigSigIntentString1); 135_intentComboBox.Items.Add(SR.DigSigIntentString2); 136_intentComboBox.Items.Add(SR.DigSigIntentString3); 137_intentComboBox.Items.Add(SR.DigSigIntentString4); 138_intentComboBox.Items.Add(SR.DigSigIntentString5); 139_intentComboBox.Items.Add(SR.DigSigIntentString6);
MS\Internal\Documents\SigningDialog.cs (6)
246_reasonComboBox.Items.Add(SR.DigSigIntentString1); 247_reasonComboBox.Items.Add(SR.DigSigIntentString2); 248_reasonComboBox.Items.Add(SR.DigSigIntentString3); 249_reasonComboBox.Items.Add(SR.DigSigIntentString4); 250_reasonComboBox.Items.Add(SR.DigSigIntentString5); 251_reasonComboBox.Items.Add(SR.DigSigIntentString6);
System.Windows.Forms (28)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxAccessibleObject.cs (2)
133List<Entry> entries = owner.Items.InnerList; 209if (selectedIndex < 0 || selectedIndex > owner.Items.Count - 1)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildListUiaProvider.cs (2)
103if (index < 0 || index >= _owningComboBox.Items.Count) 120return _owningComboBox.Items.Count;
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxItemAccessibleObject.cs (1)
106private int GetCurrentIndex() => _owningComboBox.Items.InnerList.IndexOf(_owningItem);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (20)
22[DefaultProperty(nameof(Items))] 791int itemCount = Items.Count + 1; 843if (Items is not null) 845string[] strings = new string[Items.Count]; 846for (int i = 0; i < Items.Count; i++) 848strings[i] = GetItemText(Items[i])!; 912return (index == -1) ? null : Items[index]; 1325Items.AddRangeInternal(value); 2028if (Items.Count > 0) 2047if (Items.Count > 0) 2847Items.ClearInternal(); 3012Items.AddRangeInternal(newItems); 3036Items.SetItemInternal(index, Items[index]!); 3276Items.ClearInternal(); 3277Items.AddRangeInternal(value); 3312Items.SetItemInternal(index, value); 3335private IReadOnlyList<Entry> Entries => Items.InnerList; 3396for (int i = 0; i < Items.Count; i++) 3431object? item = Items[SelectedIndex];
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (2)
1280comboBox.Items.Clear(); 1297comboBox.Items.AddRange([.. Items.InnerArray]);
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (1)
213return ComboBox.Items;
System.Windows.Forms.Design (8)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (4)
658_columnTypesCombo.Items.Clear(); 696_columnTypesCombo.Items.Add(new ComboBoxItem(type)); 837for (int i = 0; i < _columnTypesCombo.Items.Count; i++) 839if (type == ((ComboBoxItem)_columnTypesCombo.Items[i]!).ColumnType)
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (3)
102_keyComboBox.Items.RemoveAt(0); 204_keyComboBox.Items.Add(KeysConverter.ConvertToString(keyCode)!); 342_keyComboBox.Items.Insert(0, SR.ShortcutKeys_InvalidKey);
System\Windows\Forms\Design\StyleEditorForm.cs (1)
296_columnsOrRowsComboBox.Items.AddRange(
System.Windows.Forms.Tests (161)
System\Windows\Forms\AccessibleObjects\AccessibleObjectTests.cs (2)
2651comboBox.Items.Add("Item One"); 2652comboBox.Items.Add("Item Two");
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxAccessibleObjectTests.cs (12)
419Assert.Equal(comboBox.Items.Count, accessibleObject.ItemAccessibleObjects.Count); 435Assert.Equal(comboBox.Items.Count, accessibleObject.ItemAccessibleObjects.Count); 437comboBox.Items.Clear(); 450ComboBox.ObjectCollection.Entry item = comboBox.Items.InnerList[0]; 453Assert.Equal(comboBox.Items.Count, accessibleObject.ItemAccessibleObjects.Count); 455comboBox.Items.Remove(item); 469comboBox.Items.Insert(0, "h"); 472ComboBox.ObjectCollection.Entry item = comboBox.Items.InnerList[0]; 476Assert.Equal(comboBox.Items.Count - 1, accessibleObject.ItemAccessibleObjects.Count); 480comboBox.Items.Remove(item); 482Assert.Equal(comboBox.Items.Count, accessibleObject.ItemAccessibleObjects.Count); 489comboBox.Items.AddRange(
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (29)
29control.Items.AddRange(new[] { item1, item2, item3 }); 37ComboBox.ComboBoxItemAccessibleObject item1AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.Items.InnerList[0]); 38ComboBox.ComboBoxItemAccessibleObject item2AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.Items.InnerList[1]); 39ComboBox.ComboBoxItemAccessibleObject item3AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.Items.InnerList[2]); 92comboBox.Items.AddRange(new[] { "aaa", "aaa", "aaa" }); 100Assert.Equal(comboBoxItem1, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[0])); 107Assert.Equal(comboBoxItem2, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[1])); 115Assert.Equal(comboBoxItem3, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[2])); 131comboBox.Items.AddRange(new[] { "aaa", "aaa", "aaa" }); 140Assert.Equal(comboBoxItem3, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[2])); 148Assert.Equal(comboBoxItem2, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[1])); 156Assert.Equal(comboBoxItem1, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.Items.InnerList[0])); 196comboBox.Items.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); 203foreach (Entry itemEntry in comboBox.Items.InnerList) 215comboBox.Items.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); 222foreach (Entry itemEntry in comboBox.Items.InnerList) 248comboBox.Items.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); 263Entry itemEntry = comboBox.Items.InnerList[10]; 300comboBox.Items.Add(i); 315Entry itemEntry = comboBox.Items.InnerList[itemIndex]; 387comboBox.Items.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); 403Entry itemEntry = comboBox.Items.InnerList[itemIndex]; 449comboBox.Items.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }); 465Entry itemEntry = comboBox.Items.InnerList[itemIndex]; 490if (e.Index < 0 || e.Index >= Items.Count) 498Items[e.Index].ToString(), 658comboBox.Items.Add(1); 659comboBox.Items.Add(2); 660comboBox.Items.Add(3);
System\Windows\Forms\ComboBox.ComboBoxChildListUiaProviderTests.cs (1)
102comboBox.Items.AddRange(Enumerable.Range(0, 11).Cast<object>().ToArray());
System\Windows\Forms\ComboBox.ComboBoxUiaTextProviderTests.cs (23)
285comboBox.Items.Add("Some test text for testing GetLineFromCharIndex method"); 308comboBox.Items.Add("Some test text for testing GetLineFromCharIndex method"); 347comboBox.Items.Add("Some test text for testing GetLineIndex method"); 369comboBox.Items.Add("Some test text for testing GetLineIndex method"); 436comboBox.Items.Add(text); 464comboBox.Items.Add(text); 502comboBox.Items.Add(text); 541comboBox.Items.Add(text); 625comboBox.Items.Add(text); 644comboBox.Items.Add(text); 662comboBox.Items.Add(text); 678comboBox.Items.Add(text); 781comboBox.Items.Add("Some test text for testing"); 822comboBox.Items.Add("Some test text for testing"); 849comboBox.Items.Add("Some test text for testing"); 868comboBox.Items.Add("Some test text for testing"); 951comboBox.Items.Add("Some test text for testing"); 981comboBox.Items.Add("Some test text for testing"); 1012comboBox.Items.Add("Some test text for testing"); 1043comboBox.Items.Add("Some long long test text for testing GetFirstVisibleLine method"); 1063comboBox.Items.Add("Some long long test text for testing GetFirstVisibleLine method"); 1151comboBox.Items.Add("Some test text for testing GetLineFromCharIndex method"); 1172comboBox.Items.Add("Some long long test text for testing GetFirstVisibleLine method");
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (12)
429ObjectCollection comboBoxObjectCollection = comboBox.Items; 861ObjectCollection comboBoxObjectCollection = comboBox.Items; 1040ObjectCollection comboBoxObjectCollection = comboBox.Items; 1453comboBox.Items.Add("item1"); 1454comboBox.Items.Add("item2"); 1455comboBox.Items.Remove(1); 1466comboBox.Items.Add("item1"); 1467comboBox.Items.Add("item2"); 1468comboBox.Items.Insert(1, "Item3"); 1479comboBox.Items.Add("item1"); 1480comboBox.Items.Add("item2"); 1481comboBox.Items.Clear();
System\Windows\Forms\ComboBoxTests.cs (82)
93Assert.Empty(control.Items); 94Assert.Same(control.Items, control.Items); 1326control.Items.Add(new DataClass { Value = "Value1" }); 1327control.Items.Add(new DataClass { Value = "Value2" }); 1331Assert.Equal(value == -1 ? null : control.Items[control.SelectedIndex], control.SelectedItem); 1337Assert.Equal(value == -1 ? null : control.Items[control.SelectedIndex], control.SelectedItem); 1351control.Items.Add(new DataClass { Value = "Value1" }); 1352control.Items.Add(new DataClass { Value = "Value2" }); 1356Assert.Equal(value == -1 ? null : control.Items[control.SelectedIndex], control.SelectedItem); 1362Assert.Equal(value == -1 ? null : control.Items[control.SelectedIndex], control.SelectedItem); 1498Assert.Empty(controlWithNoItems.Items); 1508controlWithItems.Items.Add(new DataClass { Value = "abc" }); 1509controlWithItems.Items.Add(new DataClass { Value = "abc" }); 1510controlWithItems.Items.Add(new DataClass { Value = "ABC" }); 1511controlWithItems.Items.Add(new DataClass { Value = "def" }); 1512controlWithItems.Items.Add(new DataClass { Value = "" }); 1513controlWithItems.Items.Add(new DataClass { Value = null }); 1589control.Items.Add("item"); 1604Assert.Empty(controlWithNoItems.Items); 1615controlWithItems.Items.Add(new DataClass { Value = "abc" }); 1616controlWithItems.Items.Add(new DataClass { Value = "abc" }); 1617controlWithItems.Items.Add(new DataClass { Value = "ABC" }); 1618controlWithItems.Items.Add(new DataClass { Value = "def" }); 1619controlWithItems.Items.Add(new DataClass { Value = "" }); 1620controlWithItems.Items.Add(new DataClass { Value = null }); 1713control.Items.Add("item"); 2163control.Items.Add("item1"); 2164control.Items.Add("item2"); 2177comboBox.Items.Add("item1"); 2178comboBox.Items.Add("item2"); 2197comboBox.Items.Add("item1"); 2198comboBox.Items.Add("item2"); 2219comboBox.Items.Add("item1"); 2220comboBox.Items.Add("item2"); 2239comboBox.Items.Add("item1"); 2240comboBox.Items.Add("item2"); 2262comboBox.Items.Add(i.ToString()); 2265comboBox.SelectedItem = comboBox.Items[selectedIndex]; 2270comboBox.Items.RemoveAt(selectedIndex); 2285comboBox.Items.Add("item1"); 2286comboBox.Items.Add("item2"); 2287comboBox.SelectedItem = comboBox.Items[0]; 2302comboBox.Items.Add("item1"); 2303comboBox.Items.Add("item2"); 2307comboBox.SelectedItem = comboBox.Items[0]; 2325comboBox.Items.Add("item1"); 2326comboBox.Items.Add("item2"); 2342comboBox.Items.Add("item1"); 2343comboBox.Items.Add("item2"); 2361comboBox.Items.Add("item1"); 2362comboBox.Items.Add("item2"); 2375comboBox.Items.Add("item1"); 2376comboBox.Items.Add("item2"); 2392comboBox.Items.Add("item1"); 2393comboBox.Items.Add("item2"); 2410comboBox.Items.Add("item1"); 2411comboBox.Items.Add("item2"); 2432int count = comboBox.Items.Count; 2435comboBox.Items.Insert(index, item); 2437Assert.True(item.Equals(comboBox.Items[index])); 2438Assert.Equal(comboBox.Items.Count, ++count); 2450int count = comboBox.Items.Count; 2453comboBox.Items.RemoveAt(index); 2456Assert.Equal(count - numberOfItemsToRemove, comboBox.Items.Count); 2467int count = comboBox.Items.Count; 2470comboBox.Items.Remove(comboBox.Items[index]); 2473Assert.Equal(count - number, comboBox.Items.Count); 2490comboBox.Items.Add(item); 2498Assert.Equal(items[i], comboBox.Items[i]); 2516Assert.True(comboBox.Items[comboBox.SelectedIndex].Equals(comboBox.SelectedItem)); 2536Assert.True(comboBox.Items[comboBox.SelectedIndex].Equals(comboBox.SelectedItem)); 2576ownerDrawComboBox.Items.AddRange( 2634control.Items.Add("Item1"); 2635control.Items.Add("Item2"); 2636control.Items.Add("Item3"); 2653if (index < 0 || index >= control.Items.Count) 2697control.Items.AddRange(new string[] { "Item1", "Item2", "Item3" }); 2747comboBox.Items.Add($"item{i}"); 2750Assert.Equal(numItems, comboBox.Items.Count); 2949Items.Add($"Item {i}");
TrimTest (1)
Form1.Designer.cs (1)
80comboBox1.Items.AddRange(new object[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" });
WinFormsControlsTest (19)
Calendar.Designer.cs (1)
142this.daysOfWeekComboBox.Items.AddRange(new object[] {
CollectionEditors.cs (1)
35_stringList.ForEach(s => comboBox1.Items.Add(s));
ComboBoxes.Designer.cs (12)
56this.comboBox1.Items.AddRange(new object[] { 70this.comboBox2.Items.AddRange(new object[] { 88this.comboBox3.Items.AddRange(new object[] { 108this.comboBox4.Items.AddRange(new object[] { 122this.comboBox5.Items.AddRange(new object[] { 134this.comboBox6.Items.AddRange(new object[] { 146this.comboBox7.Items.AddRange(new object[] { 159this.comboBox8.Items.AddRange(new object[] { 172this.comboBox9.Items.AddRange(new object[] { 185this.comboBox10.Items.AddRange(new object[] { 197this.comboBox11.Items.AddRange(new object[] { 212this.comboBox12.Items.AddRange(new object[] {
ComboBoxesWithScrollBars.cs (5)
17comboBox1.Items.Add(i); 18comboBox2.Items.Add(i); 19comboBox3.Items.Add(i); 131if (e.Index < 0 || e.Index >= control.Items.Count) 139control.Items[e.Index].ToString(),