Adding multiple items to a combo box using AddRange

John picture John · May 12, 2011 · Viewed 24.9k times · Source

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

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

Answer

FIre Panda picture FIre Panda · May 12, 2011

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.