185 references to Items
PresentationUI (13)
MS\Internal\Documents\CredentialManagerDialog.cs (3)
67
_credListBox.SelectedIndex = _credListBox.
Items
.IndexOf(defaultAccount);
105
(string) _credListBox.
Items
[_credListBox.SelectedIndex]);
120
(string)_credListBox.
Items
[_credListBox.SelectedIndex]);
MS\Internal\Documents\SignatureSummaryDialog.cs (10)
319
_listBoxSummary.
Items
.Add(signatureResources);
330
if (_showRequestDialog && _listBoxSummary.
Items
.Count > 0)
360
(SignatureResources)_listBoxSummary.
Items
[_listBoxSummary.SelectedIndex],
386
(SignatureResources)_listBoxSummary.
Items
[_listBoxSummary.SelectedIndex],
419
_listBoxSummary.
Items
[_listBoxSummary.SelectedIndex]
452
_listBoxSummary.
Items
.Clear();
485
if (_documentSignatureManager.HasCertificate((SignatureResources)_listBoxSummary.
Items
[_listBoxSummary.SelectedIndex]))
532
(SignatureResources)_listBoxSummary.
Items
[e.Index]
598
if (e.Index > -1 && e.Index < _listBoxSummary.
Items
.Count)
601
SignatureResources item = (SignatureResources)_listBoxSummary.
Items
[e.Index];
System.Windows.Forms (49)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
171
return (ObjectCollection)base.
Items
;
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (6)
80
int childCount = this.TryGetOwnerAs(out ListBox? owner) ? owner.
Items
.Count : 0;
148
IReadOnlyList<ItemArray.Entry?> entries = owner.
Items
.InnerArray.Entries;
193
if (index < 0 || index >= owner.
Items
.Count || owner.
Items
.InnerArray.Count == 0)
198
ItemArray.Entry? item = owner.
Items
.InnerArray.Entries[index];
216
return this.TryGetOwnerAs(out ListBox? owner) ? owner.
Items
.Count : 0;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (24)
22
[DefaultProperty(nameof(
Items
))]
633
if (
Items
.Count == _itemsCount)
638
_itemsCount =
Items
.Count;
842
return
Items
.IndexOfIdentifier(SelectedItems.GetObjectAt(0));
1084
int cnt =
Items
.Count;
1087
if (string.Compare(value, GetItemText(
Items
[index]), true, CultureInfo.CurrentCulture) == 0)
1181
Items
.AddRangeInternal(value);
1270
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
Items
.Count);
1298
string?[] strings = new string[
Items
.Count];
1300
for (int i = 0; i <
Items
.Count; i++)
1302
strings[i] = GetItemText(
Items
[i]);
1655
int cnt =
Items
.Count;
1881
AccessibilityObject?.GetChild(
Items
.Count - 1)?.RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId);
1920
Items
.ClearInternal();
1950
int cnt =
Items
.Count;
2001
Items
.AddRangeInternal(newItems);
2034
Items
.SetItemInternal(index,
Items
[index]);
2099
Items
.ClearInternal();
2100
Items
.AddRangeInternal(value);
2133
Items
.SetItemInternal(index, value);
2211
s += $", Items.Count: {
Items
.Count}";
2212
if (
Items
.Count > 0)
2214
string? z = GetItemText(
Items
[0]);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (3)
28
protected int CurrentIndex => _owningListBox.
Items
.InnerArray.IndexOf(_itemEntry);
132
int lastItemIndex = _owningListBox.
Items
.Count - 1;
220
int itemsCount = _owningListBox.
Items
.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
244
int cnt = _owner.
Items
.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (3)
167
return _owner.
Items
.InnerArray;
189
ObjectCollection items = _owner.
Items
;
204
ObjectCollection items = _owner.
Items
;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (4)
114
return _owner.
Items
.InnerArray;
233
bool selected = _owner.
Items
.InnerArray.GetState(index, SelectedObjectMask);
259
ObjectCollection items = _owner.
Items
;
275
ObjectCollection items = _owner.
Items
;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (5)
2283
if (DropDownListBox.
Items
.Count == 0)
2313
string text = (string)DropDownListBox.
Items
[e.Index];
3719
DropDownListBox.
Items
.Clear();
3744
DropDownListBox.
Items
.Add(value);
3766
bool resizable = DropDownListBox.
Items
.Count > (DropDownListBox.Height / DropDownListBox.ItemHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
589
if (listBox.
Items
.Count == 0)
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
49
int n = _itemList.
Items
.Add(new ListItem(all[i]));
System.Windows.Forms.Design (123)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (36)
155
_listBox.
Items
.Add(created);
167
UpdateItemWidths(_listBox.
Items
[^1] as ListItem);
178
_listBox.SelectedIndex = _listBox.
Items
.Count - 1;
180
object[] items = new object[_listBox.
Items
.Count];
183
items[i] = ((ListItem)_listBox.
Items
[i]).Value;
190
if (_listBox.
Items
.Count > 0 && _listBox.SelectedIndex != _listBox.
Items
.Count - 1)
193
_listBox.SelectedIndex = _listBox.
Items
.Count - 1;
225
int c = Math.Max(2, _listBox.
Items
.Count);
259
_listBox.
Items
.Clear();
335
if (index == _listBox.
Items
.Count - 1)
341
(_listBox.
Items
[index + 1], _listBox.
Items
[index]) = (_listBox.
Items
[index], _listBox.
Items
[index + 1]);
343
if (ti < _listBox.
Items
.Count - 1)
551
foreach (ListItem i in _listBox.
Items
)
571
ListItem item = (ListItem)_listBox.
Items
[e.Index];
575
int c = _listBox.
Items
.Count;
691
object[] items = new object[_listBox.
Items
.Count];
694
items[i] = ((ListItem)_listBox.
Items
[i]).Value;
715
_listBox.
Items
.Clear();
761
_listBox.
Items
.Clear();
771
_listBox.
Items
.Add(new ListItem(_editor, items[i]));
775
if (_listBox.
Items
.Count > 0)
835
if (index < _listBox.
Items
.Count)
839
else if (_listBox.
Items
.Count > 0)
841
_listBox.SelectedIndex = _listBox.
Items
.Count - 1;
896
_listBox.
Items
.Remove(item);
907
_listBox.
Items
.Remove(item);
1004
(_listBox.
Items
[index - 1], _listBox.
Items
[index]) = (_listBox.
Items
[index], _listBox.
Items
[index - 1]);
1041
_upButton.Enabled = editEnabled && _listBox.
Items
.Count > 1;
1042
_downButton.Enabled = editEnabled && _listBox.
Items
.Count > 1;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (3)
67
listBox.
Items
.Add(newItem);
87
if (listBox.
Items
.Count > 0)
89
foreach (string s in listBox.
Items
)
System\Drawing\Design\ColorEditor.ColorUI.cs (5)
208
_lbCommon.
Items
.Clear();
211
_lbCommon.
Items
.Add(color);
214
_lbSystem.
Items
.Clear();
217
_lbSystem.
Items
.Add(color);
258
Color value = (Color)lb.
Items
[die.Index];
System\Drawing\Design\CursorEditor.CursorUI.cs (4)
39
Items
.Add(obj);
66
Cursor cursor = (Cursor)
Items
[e.Index];
117
for (int i = 0; i <
Items
.Count; i++)
119
if (
Items
[i] == value)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (5)
179
bool dataGridViewIsDataBound = _dataColumns.
Items
.Count > 0;
708
_dataColumns.
Items
.Clear();
738
_dataColumns.
Items
.Add(new ListBoxItem(propertyDescriptor.PropertyType, propertyDescriptor.Name));
743
_dataColumns.SelectedIndex = selectedIndex != -1 && selectedIndex < _dataColumns.
Items
.Count
745
: _dataColumns.
Items
.Count > 0 ? 0 : -1;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (36)
143
_selectedColumns.
Items
.RemoveAt(selectedIndex);
144
_selectedColumns.
Items
.Insert(selectedIndex, new ListBoxItem(newColumn!, this, newColumnDesigner));
288
if (e.Component is ListBoxItem && _selectedColumns.
Items
.Contains(e.Component))
660
Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.
Items
.Count - 1);
666
_selectedColumns.
Items
.RemoveAt(selectedIndex);
667
_selectedColumns.
Items
.Insert(selectedIndex + 1, item);
700
_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.
Items
.Count - 1;
711
ListBoxItem item = (ListBoxItem)_selectedColumns.
Items
[selectedIndex - 1];
712
_selectedColumns.
Items
.RemoveAt(selectedIndex - 1);
713
_selectedColumns.
Items
.Insert(selectedIndex, item);
744
_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.
Items
.Count - 1;
758
for (int i = 0; i < _selectedColumns.
Items
.Count; i++)
760
ListBoxItem? lbi = _selectedColumns.
Items
[i] as ListBoxItem;
802
_selectedColumns.SelectedIndex = Math.Min(0, _selectedColumns.
Items
.Count - 1);
805
_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.
Items
.Count - 1;
806
_deleteButton.Enabled = _selectedColumns.
Items
.Count > 0 && _selectedColumns.SelectedIndex != -1;
831
_selectedColumns.SelectedIndex = Math.Min(_selectedColumns.
Items
.Count - 1, selectedIndex);
834
_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.
Items
.Count - 1;
835
_deleteButton.Enabled = _selectedColumns.
Items
.Count > 0 && _selectedColumns.SelectedIndex != -1;
841
int insertIndex = _selectedColumns.SelectedIndex == -1 ? _selectedColumns.
Items
.Count : _selectedColumns.SelectedIndex + 1;
860
for (int i = 0; i < _selectedColumns.
Items
.Count; i++)
862
ListBoxItem? lbi = _selectedColumns.
Items
[i] as ListBoxItem;
869
_selectedColumns.
Items
.Clear();
875
_selectedColumns.
Items
.Add(new ListBoxItem(_columnsPrivateCopy[i], this, columnDesigner));
878
_selectedColumns.SelectedIndex = Math.Min(selectedIndex, _selectedColumns.
Items
.Count - 1);
882
if (_selectedColumns.
Items
.Count == 0)
907
_selectedColumns.
Items
[selectedIndex] = _selectedColumns.
Items
[selectedIndex];
951
ListBoxItem? listBoxItem = _selectedColumns.
Items
[e.Index] as ListBoxItem;
996
string columnName = ((ListBoxItem)_selectedColumns.
Items
[e.Index]).ToString();
1063
_moveDown.Enabled = _selectedColumns.
Items
.Count > 0 && _selectedColumns.SelectedIndex != _selectedColumns.
Items
.Count - 1;
1064
_moveUp.Enabled = _selectedColumns.
Items
.Count > 0 && _selectedColumns.SelectedIndex > 0;
1065
_deleteButton.Enabled = _selectedColumns.
Items
.Count > 0 && _selectedColumns.SelectedIndex != -1;
1155
for (int i = 0; i < _selectedColumns.
Items
.Count; i++)
1157
int itemWidth = TextRenderer.MeasureText(_selectedColumns.
Items
[i].ToString(), _selectedColumns.Font).Width;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (6)
47
for (int i = 0; i < _typesListBox.
Items
.Count; i++)
49
ListBoxItem item = (ListBoxItem)_typesListBox.
Items
[i];
81
_typesListBox.
Items
.Clear();
108
_typesListBox.
Items
.Add(new ListBoxItem(t));
127
for (int i = 0; i < _typesListBox.
Items
.Count; i++)
129
if (type == ((ListBoxItem)_typesListBox.
Items
[i]).ColumnType)
System\Windows\Forms\Design\FormatControl.cs (19)
48
for (int i = 0; i < formatTypeListBox.
Items
.Count; i++)
50
var formatType = (FormatTypeClass)formatTypeListBox.
Items
[i];
328
dateTimeFormatsListBox.
Items
.Clear();
329
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "d"));
330
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "D"));
331
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "f"));
332
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "F"));
333
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "g"));
334
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "G"));
335
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "t"));
336
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "T"));
337
dateTimeFormatsListBox.
Items
.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "M"));
389
formatTypeListBox.
Items
.Clear();
390
formatTypeListBox.
Items
.Add(new NoFormattingFormatType());
391
formatTypeListBox.
Items
.Add(new NumericFormatType(this));
392
formatTypeListBox.
Items
.Add(new CurrencyFormatType(this));
393
formatTypeListBox.
Items
.Add(new DateTimeFormatType(this));
394
formatTypeListBox.
Items
.Add(new ScientificFormatType(this));
395
formatTypeListBox.
Items
.Add(new CustomFormatType(this));
System\Windows\Forms\Design\ListBoxDesigner.cs (2)
155
&& e.Member.Name == nameof(ListBox.
Items
)
184
if (listBox.IsHandleCreated && listBox.
Items
.Count == 0)
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (7)
134
_itemList = new(this, _listBoxItems.
Items
, value);
466
if (_listBoxItems.
Items
.Count > 0)
512
int currentIndex = _listBoxItems.
Items
.IndexOf(currentItem);
523
int currentIndex = _listBoxItems.
Items
.IndexOf(currentItem);
662
if (listBox.
Items
[e.Index] is not Component item)
830
_btnMoveDown.Enabled = (_listBoxItems.SelectedItems.Count == 1) && (_listBoxItems.SelectedIndex < _listBoxItems.
Items
.Count - 1);
947
index = Math.Max(0, Math.Min(index, _listBoxItems.
Items
.Count - 1));