在combobox1的onchange事件中应该怎么写?
我这样写:
memo1.Lines.AddStrings(combobox1.items);它将全部的都放到memo1中了。

解决方案 »

  1.   

    你可以这样
    str := combobox1.Text;
    memo1.Lines.Add(str);
      

  2.   

    memo1.Lines.Add(ComboBox1.Text);即可
      

  3.   

    各位:
    是可以放过去了,但是它是成一列放在memo1中的,怎样成一行行的放在memo1中,当memo1中满一行后,怎么换行?
      

  4.   

    很简单:
       在combobox1 的onclick事件中写:memo1.lines.add(combobox1.text);就可以了!!!
      

  5.   

    哦, 对不起,现在我知道你的意思了,都显示在一行上,一行满后换行,对吗?
    这样就可以了:
    procedure TForm1.ComboBox1Click(Sender: TObject);
    var s:string;i:integer;
    begin
    if memo1.Text<>'' then
    begin
    memo1.MaxLength:=100;//定义一行显示的最大长度
    s:=memo1.Text;//记录第一个字串
    memo1.Lines.Text:=s+'  '+combobox1.Text;//显示出字串
    i:=length(memo1.text);//记录字串长度
    if i>100 then memo1.Lines.Add(combobox1.text);//如果到了最大长度,就增加一行
    end;
    end;
    试试吧!!!!^_^