1

When adding a ListBox to a SplitterPanel and set its Dock property to Fill, it seems that the ListBox does not take all the available space. Please take a look at the following example. You might notice the small gap at the bottom of the ListBox:

ListBox Dock

This is the layout of the Form:

Form Layout

Both, the ListBox on the left and the TextBox on the right, have their Dock property set to Fill. The TextBox behaves as expected, but for the ListBox there is always a small gap.

Is this a bug? Do you have a workaround?

P.S.: Tested on Windows 10 x64, Version 1703 with .NET Framework 4.5.1

Christian Junk
  • 1,000
  • 1
  • 8
  • 22
  • Works fine for me. Clearly something else is adding padding or something to that panel. Can you show the relevant designer code? – Equalsk Dec 07 '17 at 12:00
  • 5
    [`ListBox.IntegralHeight`](https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.integralheight(v=vs.110).aspx) – Sinatr Dec 07 '17 at 12:11
  • 3
    @Sinatr Setting the `ListBox`s `IntegralHeight` property to `False` resolved my problem. This is the solution. Thank you very much! If you add your comment as an answer to my question, I can choose it as the right answer. – Christian Junk Dec 07 '17 at 12:17

0 Answers0