1 write to _selectedColumns
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
476_selectedColumns = new ListBox();
107 references to _selectedColumns
System.Windows.Forms.Design (107)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (107)
99_selectedColumns.SelectedIndex = _columnsPrivateCopy.IndexOf((DataGridViewColumn)e.Element!); 100ListBoxItem lbi = (ListBoxItem)_selectedColumns.SelectedItem!; 112Debug.Assert(_selectedColumns.SelectedItem == item, "we must have lost track of what item is in the property grid"); 123int selectedIndex = _selectedColumns.SelectedIndex; 126_selectedColumns.Focus(); 127ActiveControl = _selectedColumns; 132ListBoxItem listBoxItem = (ListBoxItem)_selectedColumns.SelectedItem; 143_selectedColumns.Items.RemoveAt(selectedIndex); 144_selectedColumns.Items.Insert(selectedIndex, new ListBoxItem(newColumn!, this, newColumnDesigner)); 164_selectedColumns.SelectedIndex = selectedIndex; 165_propertyGrid1.SelectedObject = _selectedColumns.SelectedItem; 288if (e.Component is ListBoxItem && _selectedColumns.Items.Contains(e.Component)) 460[MemberNotNull(nameof(_selectedColumns))] 522resources.ApplyResources(_selectedColumns, "selectedColumns"); 523_selectedColumns.DrawMode = DrawMode.OwnerDrawFixed; 524_selectedColumns.Margin = new Padding(0, 2, 3, 3); 525_selectedColumns.Name = "selectedColumns"; 526_overarchingTableLayoutPanel.SetRowSpan(_selectedColumns, 2); 527_selectedColumns.SelectedIndexChanged += selectedColumns_SelectedIndexChanged; 528_selectedColumns.KeyPress += selectedColumns_KeyPress; 529_selectedColumns.DrawItem += selectedColumns_DrawItem; 530_selectedColumns.KeyUp += selectedColumns_KeyUp; 543_overarchingTableLayoutPanel.Controls.Add(_selectedColumns, 0, 1); 662int selectedIndex = _selectedColumns.SelectedIndex; 663Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 668ListBoxItem? item = (ListBoxItem)_selectedColumns.SelectedItem!; 669_selectedColumns.Items.RemoveAt(selectedIndex); 670_selectedColumns.Items.Insert(selectedIndex + 1, item); 701_selectedColumns.SelectedIndex = selectedIndex + 1; 702_moveUp.Enabled = _selectedColumns.SelectedIndex > 0; 703_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 708int selectedIndex = _selectedColumns.SelectedIndex; 714ListBoxItem item = (ListBoxItem)_selectedColumns.Items[selectedIndex - 1]; 715_selectedColumns.Items.RemoveAt(selectedIndex - 1); 716_selectedColumns.Items.Insert(selectedIndex, item); 745_selectedColumns.SelectedIndex = selectedIndex - 1; 746_moveUp.Enabled = _selectedColumns.SelectedIndex > 0; 747_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 752if (_selectedColumns.SelectedIndex != -1 && _selectedColumns.TopIndex > _selectedColumns.SelectedIndex) 754_selectedColumns.TopIndex = _selectedColumns.SelectedIndex; 761for (int i = 0; i < _selectedColumns.Items.Count; i++) 763ListBoxItem? lbi = _selectedColumns.Items[i] as ListBoxItem; 805_selectedColumns.SelectedIndex = Math.Min(0, _selectedColumns.Items.Count - 1); 807_moveUp.Enabled = _selectedColumns.SelectedIndex > 0; 808_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 809_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 810_propertyGrid1.SelectedObject = _selectedColumns.SelectedItem; 812_selectedColumns.ItemHeight = Font.Height + OWNERDRAWVERTICALBUFFER; 814ActiveControl = _selectedColumns; 818_selectedColumns.Focus(); 825Debug.Assert(_selectedColumns.SelectedIndex != -1); 826int selectedIndex = _selectedColumns.SelectedIndex; 834_selectedColumns.SelectedIndex = Math.Min(_selectedColumns.Items.Count - 1, selectedIndex); 836_moveUp.Enabled = _selectedColumns.SelectedIndex > 0; 837_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 838_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 839_propertyGrid1.SelectedObject = _selectedColumns.SelectedItem; 844int insertIndex = _selectedColumns.SelectedIndex == -1 ? _selectedColumns.Items.Count : _selectedColumns.SelectedIndex + 1; 860int selectedIndex = _selectedColumns.SelectedIndex; 863for (int i = 0; i < _selectedColumns.Items.Count; i++) 865ListBoxItem? lbi = _selectedColumns.Items[i] as ListBoxItem; 872_selectedColumns.Items.Clear(); 878_selectedColumns.Items.Add(new ListBoxItem(_columnsPrivateCopy[i], this, columnDesigner)); 881_selectedColumns.SelectedIndex = Math.Min(selectedIndex, _selectedColumns.Items.Count - 1); 885if (_selectedColumns.Items.Count == 0) 903int selectedIndex = _selectedColumns.SelectedIndex; 905Rectangle bounds = new(0, selectedIndex * _selectedColumns.ItemHeight, _selectedColumns.Width, _selectedColumns.ItemHeight); 910_selectedColumns.Items[selectedIndex] = _selectedColumns.Items[selectedIndex]; 917_selectedColumns.Invalidate(bounds); 924ListBoxItem? listBoxItem = _selectedColumns.SelectedItem as ListBoxItem; 938ListBoxItem? listBoxItem = _selectedColumns.SelectedItem as ListBoxItem; 954ListBoxItem? listBoxItem = _selectedColumns.Items[e.Index] as ListBoxItem; 997Brush backBrush = new SolidBrush(_selectedColumns.BackColor); 999string columnName = ((ListBoxItem)_selectedColumns.Items[e.Index]).ToString(); 1016if (_selectedColumns.Focused) 1063_propertyGrid1.SelectedObject = _selectedColumns.SelectedItem; 1066_moveDown.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != _selectedColumns.Items.Count - 1; 1067_moveUp.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex > 0; 1068_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 1070if (_selectedColumns.SelectedItem is not null) 1072DataGridViewColumn column = ((ListBoxItem)_selectedColumns.SelectedItem).DataGridViewColumn; 1152_propertyGrid1.SelectedObject = _selectedColumns.SelectedItem; 1158for (int i = 0; i < _selectedColumns.Items.Count; i++) 1160int itemWidth = TextRenderer.MeasureText(_selectedColumns.Items[i].ToString(), _selectedColumns.Font).Width; 1164_selectedColumns.HorizontalExtent = SelectedColumnsItemBitmap.Width + 2 * OWNERDRAWITEMIMAGEBUFFER + maxItemWidth + OWNERDRAWHORIZONTALBUFFER;