请教一个问题,谢谢各位 今天在窗体中创建了一个列表框,然后又添加了一个按钮,双击该按钮将新元素添加到Items集合中,下面是我输入的代码,使用Items集合的Add()方法IstPinkFloydAlbums.Items.Add("the division bell");提示错误,不知道为什么 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 listBox1.Items.Add(new ListItem("", "")); 你的是什么listbox啊,按道理不管是web还是WINFORM的,这个方法都可行。 1、WinForm中string[] myArray = new string[] { "Red","Green"}; this.comboBox1.Items.Add("Yellow"); this.comboBox1.Items.AddRange(myArray);2、 ASP.NET中ArrayList arrList = new ArrayList(); arrList.Add("Red"); arrList.Add("Green"); arrList.Add("Blue"); arrList.Add("LightGray"); this.DropDownList1.DataSource = arrList; this.DropDownList1.DataBind(); this.DropDownList1.Items.Insert(0, "请选择列表项"); winfom,哪里有第三方控件卖啊 webbrowser 急急急,难? 如何获取两个同时长按的键进行处理? C#中非静态字段方法属性要求对象引用 输入所有组合 非静态类中的静态方法与静态类中的静态方法在使用上有什么区别?静态类中的方法都必须是静态的吗? 一个奇怪的问题 一个复杂的问题 大家来帮帮忙啊! C#中怎样利用splitter可以鼠标拖动边框随意分割Form的左右两边的大小? vs2005中制作一个简单的留言板 求个简单正则,谢谢网友了!
string[] myArray = new string[] { "Red","Green"};
this.comboBox1.Items.Add("Yellow");
this.comboBox1.Items.AddRange(myArray);
2、 ASP.NET中
ArrayList arrList = new ArrayList();
arrList.Add("Red");
arrList.Add("Green");
arrList.Add("Blue");
arrList.Add("LightGray");
this.DropDownList1.DataSource = arrList;
this.DropDownList1.DataBind();
this.DropDownList1.Items.Insert(0, "请选择列表项");