1 write to _listBox
System.Windows.Forms.Design (1)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
408_listBox = new FilterListBox();
100 references to _listBox
System.Windows.Forms.Design (100)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (100)
83foreach (ListItem item in _listBox.SelectedItems) 131_listBox.BeginUpdate(); 141_listBox.Items.Add(created); 147_listBox.EndUpdate(); 153UpdateItemWidths(_listBox.Items[^1] as ListItem); 163_listBox.ClearSelected(); 164_listBox.SelectedIndex = _listBox.Items.Count - 1; 166object[] items = new object[_listBox.Items.Count]; 169items[i] = ((ListItem)_listBox.Items[i]).Value; 176if (_listBox.Items.Count > 0 && _listBox.SelectedIndex != _listBox.Items.Count - 1) 178_listBox.ClearSelected(); 179_listBox.SelectedIndex = _listBox.Items.Count - 1; 190_listBox.ItemHeight = Font.Height + SystemInformation.BorderSize.Width * 2; 211int c = Math.Max(2, _listBox.Items.Count); 212SizeF sizeW = g.MeasureString(c.ToString(CultureInfo.CurrentCulture), _listBox.Font); 220SizeF size = g.MeasureString(GetDisplayText(item), _listBox.Font); 245_listBox.Items.Clear(); 320int index = _listBox.SelectedIndex; 321if (index == _listBox.Items.Count - 1) 326int ti = _listBox.TopIndex; 327(_listBox.Items[index + 1], _listBox.Items[index]) = (_listBox.Items[index], _listBox.Items[index + 1]); 329if (ti < _listBox.Items.Count - 1) 331_listBox.TopIndex = ti + 1; 334_listBox.ClearSelected(); 335_listBox.SelectedIndex = index + 1; 375_listBox.KeyDown += ListBox_keyDown; 376_listBox.DrawItem += ListBox_drawItem; 377_listBox.SelectedIndexChanged += ListBox_SelectedIndexChanged; 378_listBox.HandleCreated += ListBox_HandleCreated; 392[MemberNotNull(nameof(_listBox))] 429resources.ApplyResources(_listBox, "listbox"); 430_listBox.SelectionMode = (CanSelectMultipleInstances() ? SelectionMode.MultiExtended : SelectionMode.One); 431_listBox.DrawMode = DrawMode.OwnerDrawFixed; 432_listBox.FormattingEnabled = true; 433_listBox.Margin = new Padding(0, 3, 3, 3); 434_listBox.Name = "listbox"; 435_overArchingTableLayoutPanel.SetRowSpan(_listBox, 2); 484_overArchingTableLayoutPanel.Controls.Add(_listBox, 0, 1); 518if (!_listBox.IsHandleCreated) 523using Graphics g = _listBox.CreateGraphics(); 524int old = _listBox.HorizontalExtent; 531_listBox.HorizontalExtent = w; 537foreach (ListItem i in _listBox.Items) 546_listBox.HorizontalExtent = max; 557ListItem item = (ListItem)_listBox.Items[e.Index]; 561int c = _listBox.Items.Count; 564SizeF sizeW = g.MeasureString(maxC.ToString(CultureInfo.CurrentCulture), _listBox.Font); 622if (width > e.Bounds.Width && _listBox.HorizontalExtent < width) 624_listBox.HorizontalExtent = width; 677object[] items = new object[_listBox.Items.Count]; 680items[i] = ((ListItem)_listBox.Items[i]).Value; 701_listBox.Items.Clear(); 747_listBox.Items.Clear(); 757_listBox.Items.Add(new ListItem(_editor, items[i])); 761if (_listBox.Items.Count > 0) 763_listBox.SelectedIndex = 0; 801int index = _listBox.SelectedIndex; 808if (_listBox.SelectedItems.Count > 1) 810List<ListItem> toBeDeleted = _listBox.SelectedItems.Cast<ListItem>().ToList(); 818RemoveInternal((ListItem?)_listBox.SelectedItem); 821if (index < _listBox.Items.Count) 823_listBox.SelectedIndex = index; 825else if (_listBox.Items.Count > 0) 827_listBox.SelectedIndex = _listBox.Items.Count - 1; 848int selectedItem = _listBox.SelectedIndex; 851_listBox.RefreshItem(_listBox.SelectedIndex); 861_listBox.Invalidate(); 864_propertiesLabel.Text = string.Format(SR.CollectionEditorProperties, GetDisplayText((ListItem?)_listBox.SelectedItem)); 882_listBox.Items.Remove(item); 893_listBox.Items.Remove(item); 966ActiveControl = _listBox; 985int index = _listBox.SelectedIndex; 995int ti = _listBox.TopIndex; 996(_listBox.Items[index - 1], _listBox.Items[index]) = (_listBox.Items[index], _listBox.Items[index - 1]); 1000_listBox.TopIndex = ti - 1; 1003_listBox.ClearSelected(); 1004_listBox.SelectedIndex = index - 1; 1031bool editEnabled = (_listBox.SelectedItem is not null) && CollectionEditable; 1032_removeButton.Enabled = editEnabled && AllowRemoveInstance(((ListItem)_listBox.SelectedItem!).Value); 1033_upButton.Enabled = editEnabled && _listBox.Items.Count > 1; 1034_downButton.Enabled = editEnabled && _listBox.Items.Count > 1; 1038if (_listBox.SelectedItem is not null) 1046items = [new SelectionWrapper(CollectionType, CollectionItemType, _listBox, _listBox.SelectedItems)]; 1050items = new object[_listBox.SelectedItems.Count]; 1053items[i] = ((ListItem)_listBox.SelectedItems[i]!).Value; 1057int selectedItemCount = _listBox.SelectedItems.Count; 1061_propertiesLabel.Text = string.Format(SR.CollectionEditorProperties, GetDisplayText((ListItem)_listBox.SelectedItem));