How to keep splitcontainer panel size to a ratio?

1.1k views Asked by At

I have a splitcontainer with two panels in a windows form. I keep the first panel twice the larger the second panel. But when I change the panel orientation to Vertical the first panel which appears on left now becomes smaller in the size(width) than the second panel. What I tried was this

 splitContainer1.SplitterDistance = splitContainer1.Width * 2;

But this makes the first panel larger tahan it should be.

Furthermore I tried this as the comments suggested.

splitContainer1.SplitterDistance = splitContainer1.Width / 3;

But it made the second panel area which is marked with number 1 larger. enter image description here

0

There are 0 answers