Combobox show all items

4.1k Views Asked by At

I have a ComboBox in "DropDownList" mode filled with 12 items in VB.NET program.

When I click to it on my machine with windows 7 all 12 items are showed. Same is in machine with windows 8.

But same ComboBox on machine with windows XP shows only 8 items in dropdown list and it is needed to scroll to come to last item.

Is it possible to get that all 12 items will be showed in ComboBox's dropdown list in windows XP system as well and how to get that?

1

There are 1 best solutions below

1
On BEST ANSWER

You can modify the DropDownHeight property of the ComboBox, but you will have to work out the height of each item to know how big to set this because the value is in pixels and users who have large fonts will have a larger pixel height for each item like this:

ComboBox1.DropDownHeight = ComboBox1.ItemHeight * 12

Documentation:

DropDownHeight:

http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.dropdownheight(v=vs.110).aspx

ItemHeight:

http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.itemheight(v=vs.110).aspx