In the click of the button I create some Edits
... So far everything works normally, but when I try to delete the edits
created by clicking another button, not all are deleted.
Ex. I created 10 edits
fields, when I click to delete all at once, only 5 are deleted. Here are the codes (inclusion and exclusion respectively):
for x := 0 to (NumReg -1) do
begin
ArrayEdit[x] := TEdit.Create(Self);
ArrayEdit[x].Parent := Self;
ArrayEdit[x].Name := 'edtPreco'+ IntToStr(x+1);
ArrayEdit[x].Left := 265;
ArrayEdit[x].Top := 300 + x * 25;
end;
var Component: TComponent;
begin
for Component in Self do
if Component is TEdit then
TEdit(Component).Free;
end;