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); 330if (_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(); 485if (_documentSignatureManager.HasCertificate((SignatureResources)_listBoxSummary.Items[_listBoxSummary.SelectedIndex])) 532(SignatureResources)_listBoxSummary.Items[e.Index] 598if (e.Index > -1 && e.Index < _listBoxSummary.Items.Count) 601SignatureResources item = (SignatureResources)_listBoxSummary.Items[e.Index];
System.Windows.Forms (49)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
171return (ObjectCollection)base.Items;
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (6)
80int childCount = this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0; 148IReadOnlyList<ItemArray.Entry?> entries = owner.Items.InnerArray.Entries; 193if (index < 0 || index >= owner.Items.Count || owner.Items.InnerArray.Count == 0) 198ItemArray.Entry? item = owner.Items.InnerArray.Entries[index]; 216return this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (24)
22[DefaultProperty(nameof(Items))] 633if (Items.Count == _itemsCount) 638_itemsCount = Items.Count; 842return Items.IndexOfIdentifier(SelectedItems.GetObjectAt(0)); 1084int cnt = Items.Count; 1087if (string.Compare(value, GetItemText(Items[index]), true, CultureInfo.CurrentCulture) == 0) 1181Items.AddRangeInternal(value); 1270ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 1298string?[] strings = new string[Items.Count]; 1300for (int i = 0; i < Items.Count; i++) 1302strings[i] = GetItemText(Items[i]); 1655int cnt = Items.Count; 1881AccessibilityObject?.GetChild(Items.Count - 1)?.RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId); 1920Items.ClearInternal(); 1950int cnt = Items.Count; 2001Items.AddRangeInternal(newItems); 2034Items.SetItemInternal(index, Items[index]); 2099Items.ClearInternal(); 2100Items.AddRangeInternal(value); 2133Items.SetItemInternal(index, value); 2211s += $", Items.Count: {Items.Count}"; 2212if (Items.Count > 0) 2214string? z = GetItemText(Items[0]);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (3)
28protected int CurrentIndex => _owningListBox.Items.InnerArray.IndexOf(_itemEntry); 132int lastItemIndex = _owningListBox.Items.Count - 1; 220int itemsCount = _owningListBox.Items.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
244int cnt = _owner.Items.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (3)
167return _owner.Items.InnerArray; 189ObjectCollection items = _owner.Items; 204ObjectCollection items = _owner.Items;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (4)
114return _owner.Items.InnerArray; 233bool selected = _owner.Items.InnerArray.GetState(index, SelectedObjectMask); 259ObjectCollection items = _owner.Items; 275ObjectCollection items = _owner.Items;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (5)
2283if (DropDownListBox.Items.Count == 0) 2313string text = (string)DropDownListBox.Items[e.Index]; 3719DropDownListBox.Items.Clear(); 3744DropDownListBox.Items.Add(value); 3766bool resizable = DropDownListBox.Items.Count > (DropDownListBox.Height / DropDownListBox.ItemHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
589if (listBox.Items.Count == 0)
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
49int 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); 167UpdateItemWidths(_listBox.Items[^1] as ListItem); 178_listBox.SelectedIndex = _listBox.Items.Count - 1; 180object[] items = new object[_listBox.Items.Count]; 183items[i] = ((ListItem)_listBox.Items[i]).Value; 190if (_listBox.Items.Count > 0 && _listBox.SelectedIndex != _listBox.Items.Count - 1) 193_listBox.SelectedIndex = _listBox.Items.Count - 1; 225int c = Math.Max(2, _listBox.Items.Count); 259_listBox.Items.Clear(); 335if (index == _listBox.Items.Count - 1) 341(_listBox.Items[index + 1], _listBox.Items[index]) = (_listBox.Items[index], _listBox.Items[index + 1]); 343if (ti < _listBox.Items.Count - 1) 551foreach (ListItem i in _listBox.Items) 571ListItem item = (ListItem)_listBox.Items[e.Index]; 575int c = _listBox.Items.Count; 691object[] items = new object[_listBox.Items.Count]; 694items[i] = ((ListItem)_listBox.Items[i]).Value; 715_listBox.Items.Clear(); 761_listBox.Items.Clear(); 771_listBox.Items.Add(new ListItem(_editor, items[i])); 775if (_listBox.Items.Count > 0) 835if (index < _listBox.Items.Count) 839else 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)
67listBox.Items.Add(newItem); 87if (listBox.Items.Count > 0) 89foreach (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); 258Color value = (Color)lb.Items[die.Index];
System\Drawing\Design\CursorEditor.CursorUI.cs (4)
39Items.Add(obj); 66Cursor cursor = (Cursor)Items[e.Index]; 117for (int i = 0; i < Items.Count; i++) 119if (Items[i] == value)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (5)
179bool 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)); 288if (e.Component is ListBoxItem && _selectedColumns.Items.Contains(e.Component)) 660Debug.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; 711ListBoxItem 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; 758for (int i = 0; i < _selectedColumns.Items.Count; i++) 760ListBoxItem? 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; 841int insertIndex = _selectedColumns.SelectedIndex == -1 ? _selectedColumns.Items.Count : _selectedColumns.SelectedIndex + 1; 860for (int i = 0; i < _selectedColumns.Items.Count; i++) 862ListBoxItem? 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); 882if (_selectedColumns.Items.Count == 0) 907_selectedColumns.Items[selectedIndex] = _selectedColumns.Items[selectedIndex]; 951ListBoxItem? listBoxItem = _selectedColumns.Items[e.Index] as ListBoxItem; 996string 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; 1155for (int i = 0; i < _selectedColumns.Items.Count; i++) 1157int itemWidth = TextRenderer.MeasureText(_selectedColumns.Items[i].ToString(), _selectedColumns.Font).Width;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (6)
47for (int i = 0; i < _typesListBox.Items.Count; i++) 49ListBoxItem item = (ListBoxItem)_typesListBox.Items[i]; 81_typesListBox.Items.Clear(); 108_typesListBox.Items.Add(new ListBoxItem(t)); 127for (int i = 0; i < _typesListBox.Items.Count; i++) 129if (type == ((ListBoxItem)_typesListBox.Items[i]).ColumnType)
System\Windows\Forms\Design\FormatControl.cs (19)
48for (int i = 0; i < formatTypeListBox.Items.Count; i++) 50var formatType = (FormatTypeClass)formatTypeListBox.Items[i]; 328dateTimeFormatsListBox.Items.Clear(); 329dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "d")); 330dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "D")); 331dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "f")); 332dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "F")); 333dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "g")); 334dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "G")); 335dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "t")); 336dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "T")); 337dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "M")); 389formatTypeListBox.Items.Clear(); 390formatTypeListBox.Items.Add(new NoFormattingFormatType()); 391formatTypeListBox.Items.Add(new NumericFormatType(this)); 392formatTypeListBox.Items.Add(new CurrencyFormatType(this)); 393formatTypeListBox.Items.Add(new DateTimeFormatType(this)); 394formatTypeListBox.Items.Add(new ScientificFormatType(this)); 395formatTypeListBox.Items.Add(new CustomFormatType(this));
System\Windows\Forms\Design\ListBoxDesigner.cs (2)
155&& e.Member.Name == nameof(ListBox.Items) 184if (listBox.IsHandleCreated && listBox.Items.Count == 0)
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (7)
134_itemList = new(this, _listBoxItems.Items, value); 466if (_listBoxItems.Items.Count > 0) 512int currentIndex = _listBoxItems.Items.IndexOf(currentItem); 523int currentIndex = _listBoxItems.Items.IndexOf(currentItem); 662if (listBox.Items[e.Index] is not Component item) 830_btnMoveDown.Enabled = (_listBoxItems.SelectedItems.Count == 1) && (_listBoxItems.SelectedIndex < _listBoxItems.Items.Count - 1); 947index = Math.Max(0, Math.Min(index, _listBoxItems.Items.Count - 1));