To reproduce this problem,
SplitContainer
SplitContainer
, add a ListBox
After those steps, the designer should look like this:
SplitContainer
You should see that with some sizes of the upper container, there will be a space between the two list boxes (sorry for my bad mouse-writing).
For other sizes of the upper container, there is little to no space.
I hypothesized that this is because list boxes can't show "half an item" so it reduces its size to not show that half of an item. Is this true?
I have thought of the following solution:
Restricting the resizability of the split container so the user can only resize in "steps" where each step is equal to the height of one item in the list box.
However, I don't quite like this because when the item height is large, the user experience feels unnatural (at least to me).
How can I make it so that the list boxes resize properly (i.e. leaving no gaps)?
You can set the IntegralHeight
property to false
to achieve the desired effect.
https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.integralheight(v=vs.110).aspx
Gets or sets a value indicating whether the control should resize to avoid showing partial items.