238 references to Items
DesignSurface (1)
MainForm.cs (1)
193
cb1.
Items
.AddRange(new string[] { "a1", "b2", "c3" });
PresentationUI (12)
MS\Internal\Documents\RequestedSignatureDialog.cs (6)
135
_intentComboBox.
Items
.Add(SR.DigSigIntentString1);
136
_intentComboBox.
Items
.Add(SR.DigSigIntentString2);
137
_intentComboBox.
Items
.Add(SR.DigSigIntentString3);
138
_intentComboBox.
Items
.Add(SR.DigSigIntentString4);
139
_intentComboBox.
Items
.Add(SR.DigSigIntentString5);
140
_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 (14)
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\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (6)
450
_newItemTypes.
Items
.Clear();
453
_newItemTypes.
Items
.Add(new TypeListItem(t));
463
_customItemIndex = _newItemTypes.
Items
.Count;
466
_newItemTypes.
Items
.Add(new TypeListItem(t));
549
foreach (TypeListItem item in _newItemTypes.
Items
)
685
if (box.
Items
[e.Index] is not TypeListItem typeListItem)
System.Windows.Forms.Tests (161)
System\Windows\Forms\AccessibleObjects\AccessibleObjectTests.cs (2)
2653
comboBox.
Items
.Add("Item One");
2654
comboBox.
Items
.Add("Item Two");
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxAccessibleObjectTests.cs (12)
421
Assert.Equal(comboBox.
Items
.Count, accessibleObject.ItemAccessibleObjects.Count);
437
Assert.Equal(comboBox.
Items
.Count, accessibleObject.ItemAccessibleObjects.Count);
439
comboBox.
Items
.Clear();
452
ComboBox.ObjectCollection.Entry item = comboBox.
Items
.InnerList[0];
455
Assert.Equal(comboBox.
Items
.Count, accessibleObject.ItemAccessibleObjects.Count);
457
comboBox.
Items
.Remove(item);
471
comboBox.
Items
.Insert(0, "h");
474
ComboBox.ObjectCollection.Entry item = comboBox.
Items
.InnerList[0];
478
Assert.Equal(comboBox.
Items
.Count - 1, accessibleObject.ItemAccessibleObjects.Count);
482
comboBox.
Items
.Remove(item);
484
Assert.Equal(comboBox.
Items
.Count, accessibleObject.ItemAccessibleObjects.Count);
491
comboBox.
Items
.AddRange(
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (29)
31
control.
Items
.AddRange(new[] { item1, item2, item3 });
39
ComboBoxItemAccessibleObject item1AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.
Items
.InnerList[0]);
40
ComboBoxItemAccessibleObject item2AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.
Items
.InnerList[1]);
41
ComboBoxItemAccessibleObject item3AccessibleObject = comboBoxAccessibleObject.ItemAccessibleObjects.GetComboBoxItemAccessibleObject(control.
Items
.InnerList[2]);
94
comboBox.
Items
.AddRange(new[] { "aaa", "aaa", "aaa" });
102
Assert.Equal(comboBoxItem1, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[0]));
109
Assert.Equal(comboBoxItem2, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[1]));
117
Assert.Equal(comboBoxItem3, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[2]));
133
comboBox.
Items
.AddRange(new[] { "aaa", "aaa", "aaa" });
142
Assert.Equal(comboBoxItem3, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[2]));
150
Assert.Equal(comboBoxItem2, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[1]));
158
Assert.Equal(comboBoxItem1, itemAccessibleObjects.GetComboBoxItemAccessibleObject(comboBox.
Items
.InnerList[0]));
198
comboBox.
Items
.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
205
foreach (Entry itemEntry in comboBox.
Items
.InnerList)
217
comboBox.
Items
.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
224
foreach (Entry itemEntry in comboBox.
Items
.InnerList)
250
comboBox.
Items
.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
265
Entry itemEntry = comboBox.
Items
.InnerList[10];
302
comboBox.
Items
.Add(i);
317
Entry itemEntry = comboBox.
Items
.InnerList[itemIndex];
389
comboBox.
Items
.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
405
Entry itemEntry = comboBox.
Items
.InnerList[itemIndex];
451
comboBox.
Items
.AddRange(new[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
467
Entry itemEntry = comboBox.
Items
.InnerList[itemIndex];
492
if (e.Index < 0 || e.Index >=
Items
.Count)
500
Items
[e.Index].ToString(),
660
comboBox.
Items
.Add(1);
661
comboBox.
Items
.Add(2);
662
comboBox.
Items
.Add(3);
System\Windows\Forms\ComboBox.ComboBoxChildListUiaProviderTests.cs (1)
104
comboBox.
Items
.AddRange(Enumerable.Range(0, 11).Cast<object>().ToArray());
System\Windows\Forms\ComboBox.ComboBoxUiaTextProviderTests.cs (23)
287
comboBox.
Items
.Add("Some test text for testing GetLineFromCharIndex method");
310
comboBox.
Items
.Add("Some test text for testing GetLineFromCharIndex method");
349
comboBox.
Items
.Add("Some test text for testing GetLineIndex method");
371
comboBox.
Items
.Add("Some test text for testing GetLineIndex method");
438
comboBox.
Items
.Add(text);
466
comboBox.
Items
.Add(text);
504
comboBox.
Items
.Add(text);
543
comboBox.
Items
.Add(text);
627
comboBox.
Items
.Add(text);
646
comboBox.
Items
.Add(text);
664
comboBox.
Items
.Add(text);
680
comboBox.
Items
.Add(text);
783
comboBox.
Items
.Add("Some test text for testing");
824
comboBox.
Items
.Add("Some test text for testing");
851
comboBox.
Items
.Add("Some test text for testing");
870
comboBox.
Items
.Add("Some test text for testing");
953
comboBox.
Items
.Add("Some test text for testing");
983
comboBox.
Items
.Add("Some test text for testing");
1014
comboBox.
Items
.Add("Some test text for testing");
1045
comboBox.
Items
.Add("Some long long test text for testing GetFirstVisibleLine method");
1065
comboBox.
Items
.Add("Some long long test text for testing GetFirstVisibleLine method");
1153
comboBox.
Items
.Add("Some test text for testing GetLineFromCharIndex method");
1174
comboBox.
Items
.Add("Some long long test text for testing GetFirstVisibleLine method");
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (12)
431
ObjectCollection comboBoxObjectCollection = comboBox.
Items
;
863
ObjectCollection comboBoxObjectCollection = comboBox.
Items
;
1042
ObjectCollection comboBoxObjectCollection = comboBox.
Items
;
1455
comboBox.
Items
.Add("item1");
1456
comboBox.
Items
.Add("item2");
1457
comboBox.
Items
.Remove(1);
1468
comboBox.
Items
.Add("item1");
1469
comboBox.
Items
.Add("item2");
1470
comboBox.
Items
.Insert(1, "Item3");
1481
comboBox.
Items
.Add("item1");
1482
comboBox.
Items
.Add("item2");
1483
comboBox.
Items
.Clear();
System\Windows\Forms\ComboBoxTests.cs (82)
95
Assert.Empty(control.
Items
);
96
Assert.Same(control.
Items
, control.
Items
);
1328
control.
Items
.Add(new DataClass { Value = "Value1" });
1329
control.
Items
.Add(new DataClass { Value = "Value2" });
1333
Assert.Equal(value == -1 ? null : control.
Items
[control.SelectedIndex], control.SelectedItem);
1339
Assert.Equal(value == -1 ? null : control.
Items
[control.SelectedIndex], control.SelectedItem);
1353
control.
Items
.Add(new DataClass { Value = "Value1" });
1354
control.
Items
.Add(new DataClass { Value = "Value2" });
1358
Assert.Equal(value == -1 ? null : control.
Items
[control.SelectedIndex], control.SelectedItem);
1364
Assert.Equal(value == -1 ? null : control.
Items
[control.SelectedIndex], control.SelectedItem);
1500
Assert.Empty(controlWithNoItems.
Items
);
1510
controlWithItems.
Items
.Add(new DataClass { Value = "abc" });
1511
controlWithItems.
Items
.Add(new DataClass { Value = "abc" });
1512
controlWithItems.
Items
.Add(new DataClass { Value = "ABC" });
1513
controlWithItems.
Items
.Add(new DataClass { Value = "def" });
1514
controlWithItems.
Items
.Add(new DataClass { Value = "" });
1515
controlWithItems.
Items
.Add(new DataClass { Value = null });
1591
control.
Items
.Add("item");
1606
Assert.Empty(controlWithNoItems.
Items
);
1617
controlWithItems.
Items
.Add(new DataClass { Value = "abc" });
1618
controlWithItems.
Items
.Add(new DataClass { Value = "abc" });
1619
controlWithItems.
Items
.Add(new DataClass { Value = "ABC" });
1620
controlWithItems.
Items
.Add(new DataClass { Value = "def" });
1621
controlWithItems.
Items
.Add(new DataClass { Value = "" });
1622
controlWithItems.
Items
.Add(new DataClass { Value = null });
1715
control.
Items
.Add("item");
2165
control.
Items
.Add("item1");
2166
control.
Items
.Add("item2");
2179
comboBox.
Items
.Add("item1");
2180
comboBox.
Items
.Add("item2");
2199
comboBox.
Items
.Add("item1");
2200
comboBox.
Items
.Add("item2");
2221
comboBox.
Items
.Add("item1");
2222
comboBox.
Items
.Add("item2");
2241
comboBox.
Items
.Add("item1");
2242
comboBox.
Items
.Add("item2");
2264
comboBox.
Items
.Add(i.ToString());
2267
comboBox.SelectedItem = comboBox.
Items
[selectedIndex];
2272
comboBox.
Items
.RemoveAt(selectedIndex);
2287
comboBox.
Items
.Add("item1");
2288
comboBox.
Items
.Add("item2");
2289
comboBox.SelectedItem = comboBox.
Items
[0];
2304
comboBox.
Items
.Add("item1");
2305
comboBox.
Items
.Add("item2");
2309
comboBox.SelectedItem = comboBox.
Items
[0];
2327
comboBox.
Items
.Add("item1");
2328
comboBox.
Items
.Add("item2");
2344
comboBox.
Items
.Add("item1");
2345
comboBox.
Items
.Add("item2");
2363
comboBox.
Items
.Add("item1");
2364
comboBox.
Items
.Add("item2");
2377
comboBox.
Items
.Add("item1");
2378
comboBox.
Items
.Add("item2");
2394
comboBox.
Items
.Add("item1");
2395
comboBox.
Items
.Add("item2");
2412
comboBox.
Items
.Add("item1");
2413
comboBox.
Items
.Add("item2");
2434
int count = comboBox.
Items
.Count;
2437
comboBox.
Items
.Insert(index, item);
2439
Assert.True(item.Equals(comboBox.
Items
[index]));
2440
Assert.Equal(comboBox.
Items
.Count, ++count);
2452
int count = comboBox.
Items
.Count;
2455
comboBox.
Items
.RemoveAt(index);
2458
Assert.Equal(count - numberOfItemsToRemove, comboBox.
Items
.Count);
2469
int count = comboBox.
Items
.Count;
2472
comboBox.
Items
.Remove(comboBox.
Items
[index]);
2475
Assert.Equal(count - number, comboBox.
Items
.Count);
2492
comboBox.
Items
.Add(item);
2500
Assert.Equal(items[i], comboBox.
Items
[i]);
2518
Assert.True(comboBox.
Items
[comboBox.SelectedIndex].Equals(comboBox.SelectedItem));
2538
Assert.True(comboBox.
Items
[comboBox.SelectedIndex].Equals(comboBox.SelectedItem));
2578
ownerDrawComboBox.
Items
.AddRange(
2636
control.
Items
.Add("Item1");
2637
control.
Items
.Add("Item2");
2638
control.
Items
.Add("Item3");
2655
if (index < 0 || index >= control.
Items
.Count)
2699
control.
Items
.AddRange(new string[] { "Item1", "Item2", "Item3" });
2749
comboBox.
Items
.Add($"item{i}");
2752
Assert.Equal(numItems, comboBox.
Items
.Count);
2951
Items
.Add($"Item {i}");
TestPassApp (2)
CommonControl1.Designer.cs (2)
320
this.comboBox2.
Items
.AddRange(new object[] {
345
this.comboBox1.
Items
.AddRange(new object[] {
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(),