Zitat:
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
var i:integer;
var target:string;
begin
Label1.Caption := EmptyStr;
for i := 0 to form2.listbox1.Items.Count -1 do
begin
target := Label1.Caption + listbox1.items.Strings[i] + sLineBreak;
Label1.Caption := target;
end;
end;
Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
var i:integer;
var target:string;
s:string, laenge:integer;
begin
Label1.Caption := EmptyStr;
laenge:=0;
for i := 0 to form2.listbox1.Items.Count -1 do
begin
s:=Form2.Listbox1.items[i];
if length(s)>laenge then
begin
laenge:=length(s)
target:=s;
end;
end;
Label1.caption:=target;
end;
also so würd ich das jetzt machen, denk mal das klappt *ungetestet*