1
votes

I'm working with a WinForms SplitContainer in C# and would like to set an initial size for one of the panels. I know you could set the minimum size, but beyond that I haven't been able to find anything else that would do this, and I want the panels to be resizable to whatever after the initial opening of the window.

Is there a way to do this in the Visual Studio designer (percentage-wise, one panel ~25% and the second taking the rest) without manually coding it in, which would be the obvious solution?

1
Move the splitter, works at design-time as well. - Hans Passant
@HansPassant Well I feel silly. Feel free to drop that as an answer, should've thought to check that... - RPiAwesomeness
You don't really need me to post that answer. Just finish the Q+A you started by sharing what you've learned. - Hans Passant

1 Answers

1
votes

This is doable within the designer by clicking on the slider and then resizing the panels to the size wanted (courtesy of HansPassant's comment.)

It's not highly precise, so you can't use it to be pixel-perfect, but if pixel-perfect alignment is needed then a TableLayoutPanel control makes more sense to use.