CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2001
    Posts
    49

    Listbox limit need unassigned

    I have a listbox that lists all the ticket numbers for the client to select. I didn't even think about the limit in VB until a client called our customer service. So I searched on Google and found out that you can make a unassigned for a listbox so that your index is 0 to 65436 instead of -32768 to 32768. But that only works if you have other langauges like Dephi. Any way of doing it in VB for the listbox?

    The reason I like to do this is that we learned that the client has over 35,000 ticket numbers. Most clients would likely to have less than 32,000. But this client is our big client so we have to find a way to solve this issue.

    I heard about paginate in VB? How does it work?

  2. #2
    Join Date
    Jun 2002
    Location
    Lyman ME - USA | Oneonta NY - USA
    Posts
    399

    Lightbulb

    hmmm,

    1 way to do something like this, not paginate i don't know what that is, but one way to get more than 32xxx locations would be to create an array. if you create a collection, it will increase on demand rather than forcing you to code it. It also has the built in properties. I don't think this has a limit, if so just create a regular array and do it that way....


    Dim d(65000) As Integer
    d(65000) = 564
    MsgBox d(65000)

    recieved 564 in a msgbox

    you can change int to long if the tick numbers are long too or double or whatever.... hope that suggestion helps

    - nc

  3. #3
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210
    You might want to look at the ListView control as a potential replacement. It can handle more tham 65,536 listitems and looks similiar to the user. Depending on your app, it should not be all that hard to replace your Listbox.
    I wrote a small example program comparing Listbox to Listview.
    The Listbox crapped out at 65536 listitems but the Listview did not.
    Also the Listview was much much faster.
    the attached file is the test program
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2001
    Posts
    49
    Thank you, I just realized that I could have a listview instead. But I didn't try out the code yet as I had other priorities. I am sure it will be helpful. Guess I was having a DUH moment.

  5. #5
    Join Date
    Sep 2001
    Posts
    49
    Well, I looked at the code. Notice that I should have mentioned it earlier. I do make a use of ListItem, that where it stops. I suppose I can use the Key in listview so it goes far beyond the limit.

  6. #6
    Join Date
    Sep 2001
    Posts
    49
    I still need the same UI selections as the ListBox has. You should be able to select a number of items in sequence with the mouse. ListView doesn't allow that. You have to single click each item while holding down the Shift key.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured