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;
//从表里提取
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