Pregunta

Caally estoy buscando algo como este ...

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

¿Fue útil?

Solución

Eche un vistazo a esto.

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

AddRange agrega una matriz de elementos al combobox.

Otros consejos

Podrías probar algo como

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

Esto funciona en C # 4.0, utilizando una matriz tipificada implícitamente:

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top