1
I have an application that creates Tedits from 1 to 15 I wish they would disappear, but when the person clicks on the button to create they come back..
they were created as follows:
ArrayEdit[x] := TEdit.Create(Self);
ArrayEdit[x].Parent:= Self;
ArrayEdit[x].Left := 100 + x * 50;
ArrayEdit[x].Top := 124;
ArrayEdit[x].Width := 41;
ArrayEdit[x].Height :=24;
ArrayEdit[x].Name := 'edit'+ inttostr(x+20);
And I’m destroying them this way:
for i := ComponentCount - 1 downto 0 do
begin
If (Components[i] is tedit) then
Tedit(Components[i]).Destroy;
end;
The problem is this, it gives an Access Violation error and also if you destroy the edits I will have to close the application to use them again, any idea?
I made it here using your code and it’s okay.
– user21742