[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3461
  • Last Modified:

maximum items allowed for vb6 list/combo box ?

about 32700 items allowed to be added, just like to confirm, right figure ?

2 Solutions
Fiacre, while I can not find anything that shows an exact number on the combo box, I can assure you it is greater than 32,700.
I assume that the maximum is based upon the memory of the computer.  From what I have seen there is no 'reliable' source
which states an actual amount that I am aware.
Fiarce, the only limit I have been able to find on this subject is two million.  I have took it upon myself to test this limit.
With my testing I have been able to tell that it is in fact false.  I have been able to get a combo box up to 3 million members.
With this test I am almost certain it is based upon memory.

As for list boxes, I have again been able to find unofficial/unbacked guesses on their limits.  Again, I have been able to prove these
limits of 32768 and 65536 to be false.  I have a listbox in VB6 Service Pack 6(As with the Combo test) to hold 500,000 values, this
was not the limit, just where I stopped the test, again I would guess this is also based on memory.
Okay, I ran a 3 million test on the listbox and it succeeded as well.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

From a technical perspective, the limit may be quite high, as List244 stated.

From a usability perspective, lists and combos with more than a couple hundred items are going to be a real pain.

You might want to look at ways of filtering and categorizing your content so that the list sizes are more manageable, from both perspectives.


Not indending to hijack this thread, but just expressing a curiosity, List244...
I don't doubt that you can populate a listbox with ListboxCtrl.Add dummydata with millions, but is the box actually usable in your tests?  Even the object browser looking in the VB library at the Listbox  shows clearly that several properties (index, listindex, selcount, selected() ) are integer based.  I just populated a lsitbox with 1-40000 and have a button print out the listindex on command when I've selected an entry, but the properties return (instead of crashing, surprisingly enough) distorted numbers.  
etc etc

So a question would be how usable the listbox would be above the integer limits, with the integer based functions returning different results.  What is the lixt index for the 1 millionth entry?  If you try setting the List1.TopIndex to 39900, it generates an overflow error...  Curisosity now, a million entries, I see with 40000 my numbers going from 32767 to -32768.  What happens when it gets back to -3, -2, -1.  Since -1 is 'reserved' for "not selected", does it happen?  What happens after -1 if it rolls through again?  Surely, the system is working with larger numbers, but VB is only able to see the integer bytes of it, so does it oscillate?

So populating a listbox with above 32xxx and having it actually work with that many are different stories.  Indeed, it is almost odd that it doesn't internally crash out at that limit, but allows itself to be overstuffed until you explicitly need to work with setting the parameters beyond integer limit, or grabbing them, since you would have expected it should have.  Clearly, populating the listbox (without indices) has no touching effect on its integer components, and thus is like a buffer overrun visualization....

Now returning control of this thread :)
GPrentice, that is a good point, I guess it really depends on what use the listbox will be.  If it is simply for viewing purposes
it would be alright, if you actually need data, you are right, it will not return.  However, with a combo box.. that is slightly different.
While the same problem will arise with the index, you can still grab the text of it.
The intrinsic ListBox control in VB6 is limited to a maximum of 32,767 items, which is the maximum storage size for an "Integer" data type.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now