Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Scrolling Firemonkey TFlowLayout



Permlink Replies: 1 - Last Post: Mar 25, 2018 5:43 PM Last Post By: Jeremy North
Guest
Scrolling Firemonkey TFlowLayout
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 25, 2018 7:26 AM
I'm trying to scroll in a TFlowlayout.
I used the TVertScrollbox (align to client) and a TFlowlayout (align to client as well).
The TVerticalScrllbox is the parent of TFlowlayout.
I'm using now Delphi XE8.
Any advice?

I tried:
procedure TForm1.adjustViews;
var
hh: double;
i:integer;
begin
// for grid on vertical scroll
hh:=0;
for i:=0 to FlowLayout1.ControlsCount-1 do begin
hh:=hh+FlowLayout1.Controls[i].Height;
end;
FlowLayout1.height:=hh;
end;
procedure TForm1.Button6Click(Sender: TObject);
var
but : TButton;
begin
but := TButton.Create(FlowLayout1);
but.Parent:= FlowLayout1;//FlowLayout1;
but.text := 'hi there!';
but.Height:=105;
but.Width:=177;
adjustViews;
end;

Thanks,
Luiz

Edited by: Luiz Oliveira on Mar 25, 2018 7:29 AM

Jeremy North

Posts: 402
Registered: 9/20/99
Re: Scrolling Firemonkey TFlowLayout
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 25, 2018 5:43 PM   in response to: Guest in response to: Guest
Luiz Oliveira wrote:
I'm trying to scroll in a TFlowlayout.
I used the TVertScrollbox (align to client) and a TFlowlayout (align to client as well).
The TVerticalScrllbox is the parent of TFlowlayout.
I'm using now Delphi XE8.
Any advice?

I tried:
procedure TForm1.adjustViews;
var
hh: double;
i:integer;
begin
// for grid on vertical scroll
hh:=0;
for i:=0 to FlowLayout1.ControlsCount-1 do begin
hh:=hh+FlowLayout1.Controls[i].Height;
end;
FlowLayout1.height:=hh;
end;
procedure TForm1.Button6Click(Sender: TObject);
var
but : TButton;
begin
but := TButton.Create(FlowLayout1);
but.Parent:= FlowLayout1;//FlowLayout1;
but.text := 'hi there!';
but.Height:=105;
but.Width:=177;
adjustViews;
end;

You can't align your flow layout client as well.

Align it top and set its height large enough to fit the content you want the flow layout to show.

Then you can scroll it using the scroll box.

Edited by: Jeremy North on Mar 26, 2018 11:43 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02