
Zitat von
tomate007:
Delphi-Quellcode:
if pruefung = true then begin
for i:= 1 to AnzahlSpalten-1 do begin
TEdit(Scrollbox1.FindComponent('Edit'+ IntToStr(i))).Free;
TLabel(Scrollbox1.FindComponent('Label'+ IntToStr(i))).Free;
end;
end;
SO GEHT DAS NICHT
wenn du die erste gelöscht hast gibt es die letze schon nicht mehr.
machs so
Delphi-Quellcode:
if pruefung = true then
begin
for i:= AnzahlSpalten-1 downto 1 do
begin
TEdit(Scrollbox1.FindComponent('Edit'+ IntToStr(i))).Free;
TLabel(Scrollbox1.FindComponent('Label'+ IntToStr(i))).Free;
end;
end;