W windflower Unregistered / Unconfirmed GUEST, unregistred user! 2001-03-19 #1 有listbox1和listbox2,我现在想把listbox1中所有的选中项移动到listbox2中(即将所有 的选中项添加到listbox2中,并从listbox1中删除),请问有没有现成的方法?谢谢!
有listbox1和listbox2,我现在想把listbox1中所有的选中项移动到listbox2中(即将所有 的选中项添加到listbox2中,并从listbox1中删除),请问有没有现成的方法?谢谢!
W wangjerry Unregistered / Unconfirmed GUEST, unregistred user! 2001-03-19 #2 procedure TForm1.Button1Click(Sender: TObject); var i:Integer; begin for i:=ListBox1.Items.Count-1 downTo 0 do if ListBox1.Selected then begin ListBox2.Items.Insert(0,ListBox1.Items.Strings); ListBox1.Items.Delete(i); end; end;
procedure TForm1.Button1Click(Sender: TObject); var i:Integer; begin for i:=ListBox1.Items.Count-1 downTo 0 do if ListBox1.Selected then begin ListBox2.Items.Insert(0,ListBox1.Items.Strings); ListBox1.Items.Delete(i); end; end;