Cannnot resize Child Controls in a FlowLayoutPanel

Description I tried to create a FlowLayoutPanel that can be expanded, for example, horizontally.

FlowLayoutPanel and its subcomponent anchor set to Up-Left-Right

The FlowLayoutPanel direction is set to TopDown.

-> During the regeneration of FlowLayoutPanel, its subcomponents do not change proportionally.

Step to play

  • Create a FlowLayoutPanel control in your form.

  • Set FlowDirection from FlowLayoutPanel to TopDown.

  • Create Button controls and place them in the FlowLayoutPanel control.

  • Select the button and FlowLayoutPanel and set their binding left-up left-right

  • Try expanding FlowLayoutPanel in a horizontal way.

-> FlowLayoutPanel is changing, but not a button

+5
source share
2 answers

FlowLayoutPanel is intended only for prototyping child controls in a dynamic way. This does not mean that they will automatically change within the FlowLayoutPanel. I assume that FlowLayoutPanel ignores Anchor properties for child controls.

To achieve this effect, you need to manually resize the child controls in the FlowLayoutPanel SizeChanged event.

, , , FlowLayoutPanel , . , , FlowLayoutPanel, Dock.

+6

FlowLayoutPanel . , . . FlowLayoutPanel , , .

msdn http://msdn.microsoft.com/en-us/library/ms171633.aspx

+4

All Articles