Results 1 to 7 of 7

Thread: Can listbox have a different data type? Integer 32767 is not enough.

  1. #1

    Thread Starter
    Lively Member zerodevice's Avatar
    Join Date
    Mar 2004
    Posts
    88

    Question Can listbox have a different data type? Integer 32767 is not enough.

    hi, i am doing a loop that will stores all the combinations into a listbox, however, it has more than 32767 items, what should i do?

    i did thought of using array, but i need it to be displayed and also need the index of the listbox for some calculations.

    anyway i can change the listbox's .listcount maximum into 999999 ?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    Try using a ListView instead.

  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    I suggest u use an array to manage the items and use the list box as a secondary element for visual puproses only. So u can fill the array upto 999999 but display only 5 - 10 elements in the listbox. Add a scroll bar and on change, refresh teh list items from the array. So that the scrollbar, the listbox and the array stay in sync.

    This was because even if u get a control which supports those much rows, I suppose it would be quite slow.

  4. #4

    Thread Starter
    Lively Member zerodevice's Avatar
    Join Date
    Mar 2004
    Posts
    88

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    hmm... i know what u mean. but not quite sure its a good way, because of my calculations on producing the integer values that is going to ba a lot of them. the array doesnt seem to fit in so simple.

  5. #5
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    Long and Double (and possibly Currency) Types can hold more than an Integer, although Pradeep's method isn't the best. Using an array it would take a very long time ( if not crash your PC ) to store all of the indexes in memory, let alone fill them with data.

    You can't, lower your number of items?

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  6. #6

    Thread Starter
    Lively Member zerodevice's Avatar
    Join Date
    Mar 2004
    Posts
    88

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    Quote Originally Posted by chemicalNova
    Long and Double (and possibly Currency) Types can hold more than an Integer, although Pradeep's method isn't the best. Using an array it would take a very long time ( if not crash your PC ) to store all of the indexes in memory, let alone fill them with data.

    You can't, lower your number of items?

    chem
    i sure hope i can lower the numbers of items.
    however those are actually a combinations of various hex values from 1 digit to 4 digit from 0 -> FFFF.

    i generated the list and its mroe than 32767, and so my listbox dont hold the index, and i am doign a loop to make it load the list item by index value into textbox.

    anyway, i am spliting it up into 4 listbox. that should do the job.
    Last edited by zerodevice; May 19th, 2005 at 04:00 AM.

  7. #7
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Can listbox have a different data type? Integer 32767 is not enough.

    There is not much difference in storing data in array or listbox apart from the visual effect. Both can be accessed via their index values. u just need to keep them in sync.

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