Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Raising ListIndex Maximum Value

Posted on 1999-10-15
17
Medium Priority
?
492 Views
Last Modified: 2006-11-17
I am running into a problem with the ListIndex in Visual Basic ListBox.  It seems to be a 16 bit signed integer thus it can only support 2^15 (32,768) elements.  However, I need to support up to 60,000.  Does anyone know how to increase this index?
0
Comment
Question by:TomMahieu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +5
17 Comments
 
LVL 6

Expert Comment

by:anthonyc
ID: 2129862
the listbox itself does not support more than 32768 items.  Use a Listview instead.
0
 
LVL 8

Expert Comment

by:vettranger
ID: 2129952
Also, any design that calls for displaying this many items in one 'list' needs to be rethought. It will NEVER be truly useful. Any idea that a user can deal with a list several thousand items long hasn't had enought practical thought put into it.

This idea is not unique to me, it is inherent in user interface design.

Such a list, at a minimum, needs to be broken down into an outline (such as a treeview control), or even better, a method found to intelligently query MUCH smaller subsets of the data, and display those subsets to the user. (Such as querying for items that begin with "A" when the users hits the "A" key, as a simple example).
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 2129992
agreed, 100%.  That's why MS never bothered to fix listbox to contain more items.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 2130205
A listbox with 60,000 items will take forever to fill, select from and display. Making a list like that is silly and certainly not useful. Chop it up.

M
0
 
LVL 14

Expert Comment

by:Matti
ID: 2130263
Hi!

How about using a database as datasource instead of list.

Fill about 50 items to that listbox, use compination of Add and Removeitem Listindex and TopIndex property to response user scrolling.


Matti
0
 

Author Comment

by:TomMahieu
ID: 2130288
Except that these are customer controlled list boxes (ie: they populate them.)  Many of them have needs for up to 60,000 (even though we give them other alternatives) in one index.  Accepting that we need to have a list with over 60,000 aliases, is there anyway to override the Microsoft ListIndex variable to a 32 bit number without having to re-write the control?
0
 
LVL 8

Expert Comment

by:vettranger
ID: 2130365
Tom, I'm gonna repeat :

The customer may have needs for 60,000 items in a database, he does NOT need it in a list box ... its unusable.

Find a way to let them tell the program what information (or type of information) they're looking for, and get it from the database a little at a time.

This is what querys, dynasets, and snapshots are ALL about ... giving the user palatable amounts of data.

Even if you were to succeed at this, you'd be redoing the interface as soon as they try to use it! LOL

If nothing else moves you (or the customer), just think about all the salaried time wasted while an employee attempts to find something in a 60,000 line list box. How much time wasted while its filled? How much system resources and stack spaced tied up? I could go on.

Frankly, if I had a listbox fill up with 100 items, I'd be scratching my head and wondering how I'd gotten it so wrong!
0
 
LVL 2

Expert Comment

by:taplin
ID: 2130591
Tom... no, you cannot increase the amount of possible listitems that can be held in a list box.  If you absolutely must do what you are aiming to do, perhaps you could build a listbox control for yourself, using Visual Basic's UserControl object.  It wouldn't be too hard, I don't think (but, I have never done it).

I do recognize what you are saying, Tom, about the client wanting to be able to do it the way they want to do it.  In my contract work I have had a lot of clients request things that are just absolutely ludicrous... I attempt to talk them out of it, but in the end, they are paying.  I just make sure they know that what they are requesting is against better judgement.

So, again, perhaps you could write a control, or you could use the ListView control...

Jay
0
 
LVL 14

Accepted Solution

by:
mcrider earned 200 total points
ID: 2130602
if you really want a list, swap out the listbox control for a listview control... you have to add items differently, but at least to have the list.  (it populates using nodes just like treeview)

Cheers!
0
 
LVL 8

Expert Comment

by:vettranger
ID: 2130705
mcrider's answer already given in the very first comment by anthonyc ...
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 2130708
how is this an answer?  I said the SAME THING as a comment
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2130769
sorry, click "answer" instead of "comment".... But that wouldn't be necessary if the person claiming to answer the question would just answer it...

Almost all of the questions in the "Questions Awaiting Answers" are strings of comments with nobody claiming points.  They just sit there.... Sorry again... Venting ;>

Cheers!
0
 
LVL 8

Expert Comment

by:vettranger
ID: 2130845
(Good to know you're aware there IS a comment button! LOL)

That's because many people making these comments don't want to lock down the question until they are pretty sure they are solving the issue ... and even then it may not be the case, as we've all been rejected anyway from time to time.

Also, there are some questions that its pretty obvious right from the get go there's going to be no answer for ...  (Not saying that this is one of them.) Either the question is WAY too general, or the questioner wants to do something so off the wall that no one's ever been there before.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2130904
vettranger,

Last time I looked, there were 617...618...617... question waiting to be answered...  Most of them are just there...  I guess I just disagree.  Dead unanswered questions/accepted answers are just clutter.

Oh well, I guess life is one of those female dogs in heat...


Cheers!
0
 
LVL 2

Expert Comment

by:taplin
ID: 2130926
Just because it's fun to get in on a fight....

I'd have to side with mcrider...

anthonyc - if you don't like that mcrider answered the question with the same thing you said, tough luck!  He ANSWERED it... you did not.  It is up to Tom to determine whether or not he appreciates the response.  If Tom liked the answer, anthonyc, he could not give you the points anyways...  if you want points, ANSWER the question.  Else, let someone else claim the points.

Are we all adults here?  As programmers, I thought we're supposed to be a little smarter and a little better than the rest... yet to me it seems that half of the people in this experts exchange behave like little children!
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2131003
taplin... ;-)

Others... Fight! Fight! Fight!

Looking for some female dog slappin! (ROTFLMAO)

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6843325
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question