Thank you Mattias, unique names solved the issue, I was wrongly naming frames: MyFrames[i].Name := Format('Frame%d', [i]);
Last question: I am creating Frames within a ScrollBox, but it look like there is a limit of the ScrollBox height to 32768 pixels. I'd like to display up to 500 questions (Frames), how can I solve this issue? [image: Inline images 1] On 30 June 2017 at 22:59, Mattias Gaertner via Lazarus < lazarus@lists.lazarus-ide.org> wrote: > On Fri, 30 Jun 2017 22:46:17 +0200 > Sandro Cumerlato via Lazarus <lazarus@lists.lazarus-ide.org> wrote: > > > Thank you Adrian for your reply, > > I can create a good layout with Frames, but it looks like I cannot create > > multiple frames on the same form... Duplicate name: A component named > > "Frame1" already exists. > > > > I tried to create an array of Frames at runtime: > > > > Question 1? (Option A) (Option B) > > Question 2? (Option A) (Option B) > > Question 3? (Option A) (Option B) > > Question 4? (Option A) (Option B) > > ... > > Question 200? (Option A) (Option B) > > > > > > var > > MyFrames: array[1..200] of TFrame1; > > > > > > Where am I wrong? > > Give your frames unique names. > > DisableAutoSizing; > try > for i:=1 to 200 do begin > MyFrames[i]:=TFrame1.Create(Self); > with MyFrames[i] do begin > Name:='MyFrame'+IntToStr(i); > Top:=i*Height; > Parent:=Self; > end; > end; > finally > EnableAutoSizing; > end; > > > Mattias > -- > _______________________________________________ > Lazarus mailing list > Lazarus@lists.lazarus-ide.org > http://lists.lazarus-ide.org/listinfo/lazarus >
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus