We help IT Professionals succeed at work.

How to set the default splitter pane size in a splitter conrol

brgdotnet asked
I have a windows form with a splitter control on it. The layout or the two split panes are Horizontal, so they appear to be stacked on each other.

The top pane has various controls in it. The bottom pane has a GridView in it.

 Now when the form displays my bottom pane in the splitter is much smaller in height compared to the top splitter pane/panel.
How can I control the size of the bottom default/pane/panel when the form is initially displayed?
Watch Question

Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Hi brgdotnet,

It will be as per your selection in designer. You can adjust it via the designer OR after your have initialized form controls, you can adjust it programmatically. If you want the fixed size then I suggest you take the designer and if you want it to be dynamic, you have to resize it when the Form resizes.

Senior .Net Consultant
Top Expert 2016
You can set the distance of the splitter by setting the SplitterDistance property like this:

SplitContainer1.SplitterDistance = 200

Open in new window