I have an application that creates TEdits from 1 to 15 I would like them to disappear, but when the person clicks the button to create them 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 as follows:
for i := ComponentCount - 1 downto 0 do
begin
If (Components[i] is tedit) then
Tedit(Components[i]).Destroy;
end;
The problem is as follows, it gives an Access Violation error and also seeu destroy the edits will I have to close the application to use them again, any ideas?