请问memo的什么属性可以设置它显示的行数?
我写了个程序,它只能显示两行,这是为什么。谢谢大家delphi memo

解决方案 »

  1.   

     memo1.Lines.Add('插入第一行');
     memo11.Lines.Add('插入第二行');
     。
     memo1.Lines.Add('插入第N行');
      

  2.   

    但是像 Memo1.Lines[3]:=Memo1.Lines[3]+CheckListBox1.Items.Strings[Item2]+' ';
    这样的语句又不可以用add啊。大神,这个怎么解决?
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
       Item:integer;
    begin
          RichEdit1.Lines[0]:='我最喜欢的PC机品牌有:';
          RichEdit1.Lines[1]:='';         //PC机品牌
          for Item:=0 to ListBox1.Items.Count-1 do
          if ListBox1.Selected[Item] then
             RichEdit1.Lines[1]:=RichEdit1.Lines[1]+ListBox1.Items.Strings[Item]+'  ';      RichEdit1.Lines[3]:='我最喜欢的手机品牌有:';
          RichEdit1.Lines[4]:='';         //手机品牌
          for Item:=0 to CheckListBox1.Items.Count-1 do
          if CheckListBox1.Checked[Item] then
             RichEdit1.Lines[4]:=RichEdit1.Lines[4]+CheckListBox1.Items.Strings[Item]+'  ';      RichEdit1.Lines[6]:='我最近想买'+ComboBox1.Text;
    end;
      

  4.   

    我想让它一次性在屏幕上显示出来。用richedit和memo都不行,都只能显示两行,我把maxlength也设置成了0,还是不行。
      

  5.   


    var
      Item: integer;
    begin
      memo1.Clear;
      memo1.Lines.Add('我最喜欢的PC机品牌有:');  for Item := 0 to ListBox1.Count - 1 do
      begin
        if ListBox1.Selected[Item] then
          memo1.Lines.Add(ListBox1.Items.Strings[Item]);
      end;  memo1.Lines.Add(''); // 分隔行  memo1.Lines.Add('我最喜欢的手机品牌有:');
      for Item := 0 to ListBox1.Items.Count - 1 do
      begin
         if ListBox1.Checked[Item] then
          memo1.Lines.Add(ListBox1.Items.Strings[Item]);
      end;  memo1.Lines.Add('我最近想买' + ComboBox1.Text);end;
     
      

  6.   

    这里写错了,居然你没问题?
      memo1.Lines.Add('我最喜欢的手机品牌有:');
      for Item := 0 to ListBox1.Items.Count - 1 do // 这里的ListBox1应该是CheckListBox1
      begin
         if ListBox1.Checked[Item] then
          memo1.Lines.Add(ListBox1.Items.Strings[Item]);
      end;