1
I have a form in Delphi and I wanted to have a pre-created frame added dynamically several times by clicking a button. 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 executing I am notified of the following error:
"A Component named Frame already exists"
I’ve searched a lot of sites, and I can’t find a solution to that problem. I found an almost identical question in this link but unsolved.
Your code works perfectly here. There’s something else in your code ?
– Victor Tadashi