ListBox ab=new ListBox();
ab.DataSource =new string[]{"AAA","BBB","CCC"};
this.Controls.Add(ab);

解决方案 »

  1.   

    ListBox ab=new ListBox();
    ab.DataSource =new string[]{"东","西","南","北"};
    this.Controls.Add(ab);
    或者
    ListBox ab=new ListBox();
    ab.Items.Add("东");
    ab.Items.Add("南");
    ab.Items.Add("西");
    ab.Items.Add("北");
    this.Controls.Add(ab);
      

  2.   

    ab.Items.Add 
    不是加集合
      

  3.   

    ListBox ab=new ListBox();
    //set up properties on the listbox here 
    ab.Items.Add(new String[]{"东","西","南","北"});
    this.Controls.Add(ab);
      

  4.   

    ab.Items.Add(new String[]{"东","西","南","北"});不能够显示东南西北