开发者

Adding multiple items to a combo box using AddRange

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

cbo_G开发者_如何学编程enre.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"});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜