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

brgdotnet
brgdotnet used Ask the Experts™
on
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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
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.

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

SplitContainer1.SplitterDistance = 200

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial