문제

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

cbo_Genre.Items.AddRange({"Horror", "Comedy"});
도움이 되었습니까?

해결책

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.

다른 팁

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"});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top