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