Thema: Delphi Listtbox- kopieren ?

Einzelnen Beitrag anzeigen

uwewo

Registriert seit: 14. Jul 2004
Ort: Karlsruhe
479 Beiträge
 
Delphi 2006 Professional
 
#9

Re: Listtbox- kopieren ?

  Alt 12. Okt 2006, 12:19
Habe zum Test nur mal was ausprobiert. Also bestimmt nicht optimal, aber funtionsfähig.

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
   AnzZei : Integer;
   AnzPW : Integer;
   s1 : Tstringlist;
   i : Integer;
   begin
   listbox1.items.Clear;
   listbox1.Items.add ('111');
   listbox1.Items.add ('222');
   listbox1.Items.add ('333');
   s1 := TStringlist.create;
   listbox1.Items.Text;//.selectall;
   if ListBox1.SelCount = 0 then Exit;
   for i := 0 to ListBox1.Items.Count - 1 do
    if ListBox1.Selected[i] then
   s1.add(listbox1.Items[i]);
   ClipBoard.AsText := listbox1.Items.Text;
   s1.Free;
   exit;

end;
Uwe
  Mit Zitat antworten Zitat