2

At design time I have a form with a FlowLayoutPanel. I can create buttons inside it with no problems. But when I tried to add a SplitContainer, nothing happens.

Later I will need to add a Splitcontainer inside another SplitContainer. So my user can choose the number of sections (panels) he wants to see in the form.

I'm trying this:

        SplitContainer spltcnt = new SplitContainer();
        spltcnt.Dock = DockStyle.Fill;
        spltcnt.Orientation = Orientation.Horizontal;
        spltcnt.SplitterWidth = 100;
        spltcnt.Visible = true;

        flwLayoutPanel.Controls.Add(spltcnt);
H H
  • 263,252
  • 30
  • 330
  • 514
  • Have you tried setting DockStyle.Fill; on something inside a Flowlayout with the designer? I suggest you set Height and Width instead. – H H Oct 21 '15 at 16:48

1 Answers1

0

You can't dock in a FlowLayoutPanel as per this SO question (among others). You will have to manually set the Height and Width of your SplitContainers when the form is resized.

Community
  • 1
  • 1
Brandon
  • 4,491
  • 6
  • 38
  • 59