增加
with listview1.items.add do
begin
  caption:='1212';
  subitems.add('hh1');
  subitems.add('hh2');
end;删除
listview1.items.delete(0);

解决方案 »

  1.   

    //从表里提取
      ListView1.Items.Clear;
      with adoquery1 do
        begin
          close;
          sql.Clear;
          sql.Add('select spmc,jg,sl from kcxs');
          Open;
          ListView1.Items.Clear;
          while not eof do
            begin
              tmp_item:=ListView1.Items.add;
              tmp_item.Caption:=FieldByName('spmc').Value;
              Tmp_item.SubItems.Add(FieldByName('sl').Value);
              Tmp_item.SubItems.Add(FieldByName('jg').Value);
              next;
            end;
        end;
    //删除
      ListView1.DeleteSelected
      

  2.   

    to make11111(可可)
    我现在要交任务,没时间了
      

  3.   

    for I := 1 to 9 do
        ListBox1.Items.Add('abc' + IntToStr(I));procedure TForm1.Button1Click(Sender: TObject);
    var
      a:integer;
    begin
        a:=ListBox1.ItemIndex;
        ListBox2.Items.add(ListBox1.Items.Strings [a]);
        listbox1.Items.Delete(a);
    end;procedure TForm1.Button3Click(Sender: TObject);
    var
      b:integer;
    begin
        b:=ListBox2.ItemIndex;
        ListBox1.Items.add(ListBox2.Items.Strings [b]);
        listbox2.Items.Delete(b);
    end;
      

  4.   

    for I := 1 to 9 do
        ListBox1.Items.Add('abc' + IntToStr(I));
    procedure TForm1.Button1Click(Sender: TObject);
    var
      a:integer;
    begin
        a:=ListBox1.ItemIndex;
        ListBox2.Items.add(ListBox1.Items.Strings [a]);
        listbox1.Items.Delete(a);
    end;procedure TForm1.Button3Click(Sender: TObject);
    var
      b:integer;
    begin
        b:=ListBox2.ItemIndex;
        ListBox1.Items.add(ListBox2.Items.Strings [b]);
        listbox2.Items.Delete(b);
    end;