Delphi implementation of the TFlowPanel
control seems to lack an important feature of the C# version, the AutoScroll
one.
The C# control with AutoWrap= False
and AutoScroll=True
behave like a horizontal scrollable list of controls.
How can i mimic the behavior of the C# version of the control ?
Thanks, Alin
P.S.
I know i can use TScrollBox
to get this behavior but TFlowPanel
(in the not crippled version) allow for much more flexibility.
Create your TFlowPanel inside a TScrollBox, with the following properties:
That should get you the behaviour you are after I think.
If you want to scroll vertically set
FlowPanel1.Align := alTop;
FlowPanel1.AutoSize := True;
FlowPanel1.AUtoWrap := False;
For people who are looking for a working vertical scrolling method:
procedure TfrmSample.FixVerticalScroll(const AFloatPanel: TFloatPanel);
begin
fFloatPanel.Align := alTop;
fFloatPanel.AutoSize := True;
fFloatPanel.AutoWrap := True;
fFloatPanel.OnResize := OnFlowPanelResize;
end;
procedure TfrmSample.OnFlowPanelResize(Sender: TObject);
begin
// Fix: otherwise panel is not operating on the full width
fFloatPanel.Align := alClient;
fFloatPanel.Align := alTop;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With