I created a dialog with three buttons. I put those buttons in a FlowLayoutPanel with FlowDirection set to TopDown.
I attempted to Size the buttons to the width of the panel and then set the Anchor to Left+Top+Right. This seems to have no effect in a FlowLayoutPanel.
Is there a simple solution to this? I know I can use the FlowLayoutPanel's OnResize event, and go that direction, but was hoping for a design-time setting.
StackPanel is a layout panel that arranges child elements into a single line that can be oriented horizontally or vertically. By default, StackPanel stacks items vertically from top to bottom in the order they are declared. You can set the Orientation property to Horizontal to stack items from left to right.
A StackPanel allows you to stack elements in a specified direction. By using properties that are defined on StackPanel, content can flow both vertically, which is the default setting, or horizontally.
You can use the TableLayoutPanel
, if the explicit row management isn't too annoying.
To achieve this layout, merely set all the following properties on a FlowLayoutPanel
:
AutoScroll = True FlowDirection = TopDown WrapContents = False
Check this for details
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