How to get FlowLayoutPanel.AutoSize to work with FlowBreak

前端 未结 3 1088
忘掉有多难
忘掉有多难 2021-01-04 06:50

I have a problem with a FlowLayoutPanel and I don\'t know how to solve it.

I\'m placing two FlowLayoutPanels inside another; the second inner flp has 3 buttons insid

3条回答
  •  旧巷少年郎
    2021-01-04 07:38

    I don't believe the FlowLayoutPanel was designed to do what you're trying to do. A TableLayoutPanel would probably be better suited. Add a TableLayoutPanel with a single column, and add each button to a row.

    Edit: I found a hackish work around. After the first button, create a Panel with the size of 0,0 and the margin of 0,0. Make sure that FlowBreak is set to false.

    enter image description here

    Edit: You only need to create one panel, after the first button, not one for each.

提交回复
热议问题