Search code examples
c#visual-studio-2008comboboxaddrange

Adding multiple items to a combo box using AddRange


Baically I'm looking for something like this...

cbo_Genre.Items.AddRange({"Horror", "Comedy"});

Solution

  • Have a look at this.

    ComboBox1.Items.AddRange(new string[]{"Typical", "Compact", "Custom"});
    cbo_Genre.Items.AddRange(new string[]{"Horror", "Comedy"});
    

    AddRange adds an array of items to the ComboBox.