新手请教memo的一个小问题

小熊猫0512 2013-09-03 03:03:50
请问memo的什么属性可以设置它显示的行数?
我写了个程序,它只能显示两行,这是为什么。谢谢大家
...全文
134 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
小熊猫0512 2013-09-05
  • 打赏
  • 举报
回复
我自己改了~~多谢~~
sololie 2013-09-04
  • 打赏
  • 举报
回复
这里写错了,居然你没问题?

  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;
小熊猫0512 2013-09-03
  • 打赏
  • 举报
回复
非常感谢~~
sololie 2013-09-03
  • 打赏
  • 举报
回复

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;
小熊猫0512 2013-09-03
  • 打赏
  • 举报
回复
我想让它一次性在屏幕上显示出来。用richedit和memo都不行,都只能显示两行,我把maxlength也设置成了0,还是不行。
小熊猫0512 2013-09-03
  • 打赏
  • 举报
回复
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;
sololie 2013-09-03
  • 打赏
  • 举报
回复
搞不懂你想干嘛啊
小熊猫0512 2013-09-03
  • 打赏
  • 举报
回复
但是像 Memo1.Lines[3]:=Memo1.Lines[3]+CheckListBox1.Items.Strings[Item2]+' '; 这样的语句又不可以用add啊。大神,这个怎么解决?
sololie 2013-09-03
  • 打赏
  • 举报
回复
memo1.Lines.Add('插入第一行'); memo11.Lines.Add('插入第二行'); 。。。。 memo1.Lines.Add('插入第N行');

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧