Winforms: FlowLayoutPanel docked

This is in winforms. I am creating a user control, which is basically a FlowlayoutControl populated by other user controls. I need each control to be attached to the top of the previous one (from left to right). Unfortunately, it seems that flowlayoutcontrol is ignoring any docking properties. Is there a way to dock controls inside? I need this to fill an element from left to right, but the elements should be laid out as a list view. Theres really no code I can provide because its a question to figure out which approach to take.

+4
source share
3 answers

The FlowLayoutPanel.FlowDirection property indicates the flow direction of the FlowLayoutPanel control.

The FlowLayoutPanel.WrapContents property indicates whether the FlowLayoutPanel control should wrap its contents or allow to trim the content.

+4
source

FlowLayoutPanel . - . , ( ) " " FlowLayoutPanel. . VS, . " " , , .

, , . , .

, Layout FlowLayoutPanel , . , "none". , , .

flowLayoutPanel.Controls[0].Dock = DockStyle.None;                
flowLayoutPanel.Controls[0].Width = flowLayoutPanel.DisplayRectangle.Width - lowLayoutPanel.Controls[0].Margin.Horizontal;

for (int i = 1; i < flowLayoutPanel.Controls.Count; i++)
{
    flowLayoutPanel.Controls[i].Dock = DockStyle.Top;
} 
+10

FlowLayoutPanel (, , FlowLayoutPanel ..), .

DefaultPadding DefaultMargin, ,

+1

All Articles