MikisaMaliDojnik
MikisaMaliDojnik

Reputation: 87

Resizing listbox badly in custom UserControl

I made custom control and i want listbox to be at the bottom of it . Like on picture bellow:
enter image description here
Only thing that i did is that i set dock property to bottom. And that do my job , but soon i realised that , when im resizing my control vertically , listbox is not resizing well.
Here is picture enter image description here
Background color of my control is red , so listbox is not resizing well, i dont know why, but if i move control one more pixel down, the listbox would be moved nicely, but if i continue to move, it is same.

I discovered that every 11 pixels listbox resizes well, but on 12th , control is resizing , but listbox doesnt , again


Anybody knows why?

Upvotes: 0

Views: 83

Answers (1)

allonym
allonym

Reputation: 1418

Assuming this is WinForms, check the IntegralHeight property on the listbox. When true, the listbox height will always be a multiple of the item height, which is probably what's causing the behavior you're seeing.

Upvotes: 1

Related Questions