Re: VB6 LISTBOX problem
- From: "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 20 Oct 2007 11:47:07 -0500
"mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
news:ewfd$AyEIHA.3980@xxxxxxxxxxxxxxxxxxxxxxx
I have a problem with a listbox.
I believe the problem is the 'limitation' of the 'listbox' control
rather than anything I've done.
I want to add 47,232 entries to the listbox,
I've added the records using 'LIST1.ADDITEM x' without any problems (I
think, data looks ok).
If you look at the ListCount property you'll
see it's an integer. So that's your limitation.
No need to run Ivar's code. All he was trying
to say is that it doesn't work. (I wasted my time
trying it so others won't have to. :)
I've seen code, I think it was in VBPJ a few years
ago, that designs a fast Listbox by loading it
dynamically. You might check around for that. I
think the way it worked was to store the values
in an array and then subclass the Listbox, updating
it's display as it's scrolled, so that it's never actually
holding more than a few items.
Just to elaborate, Integers in VB6 are 16-bit numbers that range from -2^15
to 2^15 -1, or -32,768 to 32,767.
My guess is that the ListCount property properly increments up to 32,767,
then the next value after that is -32,768, then -32,767, and so on up
to -18,304. So the value -18,304 corresponds to 32,768 + (-18,304 + 32,768)
= 47,232. Of course you can't take advantage of this (you don't know how
many times the property cycled through valid values), but it explains where
the number came from. In any case that many entries in a listbox is not
practical.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
.
- Follow-Ups:
- Re: VB6 LISTBOX problem
- From: xx3884@xxxxxxxxxxxxxx
- Re: VB6 LISTBOX problem
- References:
- VB6 LISTBOX problem
- From: xx3884@xxxxxxxxxxxxxx
- Re: VB6 LISTBOX problem
- From: mayayana
- VB6 LISTBOX problem
- Prev by Date: Re: VB6 LISTBOX problem
- Next by Date: Re: VB6 LISTBOX problem
- Previous by thread: Re: VB6 LISTBOX problem
- Next by thread: Re: VB6 LISTBOX problem
- Index(es):
Relevant Pages
|