private void comboBox1_DropDown(object sender, EventArgs e) { comboBox1.SelectAll(); // selects all items in the dropdown list }
private void button1_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex != -1) { comboBox1.Items.RemoveAt(comboBox1.SelectedIndex); // removes the selected item from the ComboBox } comboBox1.SelectAll(); // selects all remaining items in the dropdown list }In this example, the SelectAll method is called after removing a selected item from the ComboBox, allowing the user to easily select all remaining items at once. The package library for this class is included in the .NET Framework Class Library.