rt

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        ComboBox1: TComboBox;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
        combobox1.Items.Add('ABC');
        combobox1.Items.Add('cde');
    end;end.
      

  2.   

    还有一中: combobox1.Items.CommaText :='ABC,abc';
    就添加了 ABC 和 abc  下拉框
      

  3.   

     combobox1.Items.CommaText :='AAA,bbb';
    添加 AAA 和  bbb  下拉框
      

  4.   

    1、直接付值:
    combobox1.Items.Add('ABC');
    combobox1.Items.Add('cde');
    2、如果是要从表中读取来绑定:
    ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Add('select id from table order by id');
    ADOQuery1.Open;
    if ADOQuery1.RecordCount >0 then
    begin
      ComboBox1.Items.Clear;
      ADOQuery1.First;
      while not ADOQuery1.Eof do
      begin
        ComboBox1.Items.Add(ADOQuery1.fieldbyname('id').AsString) ;
        ADOQuery1.Next;
      end;
    end;