16,748
社区成员
发帖
与我相关
我的任务
分享
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;
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;