Question

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

cbo_Genre.Items.AddRange({"Horror", "Comedy"});
Was it helpful?

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.

OTHER TIPS

You could try something like

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

This works in C# 4.0, using an implicitly typed array:

cbo_Genre.Items.AddRange(new[] {"Horror", "Comedy"});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top