1

I need to arrange a few of my controls using split containers such that one split container is nested inside another. I find that each instance of the SplitContainer class is itself a Control and comes with two instances of SplitterPanel which is a control too.

For example, in the following illustration, I am arranging just 3 of my controls (HWNDs 8, 9 and 5) using 2 SplitContainer instances but end up with a whole lot of additional HWNDs as a result of using SplitContainer.

Split Container
(source: googlepages.com)

In addition to this, the child controls must use Parent.Parent.Parent... ad nauseum in order to reach their parent form (yes I can use FindForm instead). Is there a better way to do this?

Edit: The splitter needs to be resizable

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Agnel Kurian
  • 57,975
  • 43
  • 146
  • 217

1 Answers1

1

You could use a TableLayoutPanel where you give the bottom control ColumnSpan of two.

You can do this in code with

this.tableLayoutPanel.SetColumnSpan(this.button1, 2);

Or use the properties window in the designer.

Mikko Rantanen
  • 7,884
  • 2
  • 32
  • 47