I have a form in delphi and wanted to click a button a pre-created frame was added dynamically several times. I'm trying through this code:
procedure TMain.Button1Click(Sender: TObject);
var i:integer; frame:TFrame;
begin
for i:=0 to 5 do
begin
frame := Tframe.create(self);
with frame do
begin
parent:= self;
left:= 376 + (i*220);
top:= 136 + (i*332);
end;
end;
end;
When running, I'm notified of the following error:
"A component named Frame already exists"
I have already looked at several sites and I do not find the solution to this problem. I found an almost identical question on this link but no solution.