例如:按一下,combobox中有个数据1,再按一下,就添一个2,再按,3.............
问题可能比较简单,请高手指教!!!!!先谢谢了,偶是新人,分不多啊!~~

解决方案 »

  1.   

    用一个全局变量(比如i)记录当前的值,然后在按钮事件中写
      combobox1.Items.Add(IntToStr(i));
      Inc(i);
      

  2.   

    在按钮点击事件中写:
    procedure TF_TEST2.Button1Click(Sender: TObject);
    var
      i:integer;
    begin
      
      for i:=0 to 10 do
      begin
        combobox1.Items.Add(inttostr(i));
      end;
    end;end.
      

  3.   

    ComboBox1.Items.Add(IntToStr(ComboBox1.Items.Count + 1));
      

  4.   

    那如果说要加如某个特定的值呢?比如:要从另外一个listbox中加入呢?
      

  5.   

    ListBox的Items属性和ComboBox的Items属性类型相同都是TStrings.具体处理自己定咯.要是全复制可以用
    ComboBox1.Items.AddStrings(ListBox1.Items);
      

  6.   

    procedure TForm1.ListBox1DblClick(Sender: TObject);
    begin
    if ComboBox1.Items.IndexOf(ListBox1.Items[ListBox1.ItemIndex])=-1 then
      ComboBox1.Items.Add(ListBox1.Items[ListBox1.ItemIndex]);
    end;