Results 1 to 11 of 11

Thread: ListBox Limitations

  1. #1
    needaname16
    Guest

    Talking ListBox Limitations

    Hi,

    I have a ListBox control that I want to fill with a maximum of 37767 records, I also want to enable Multiple select with the ability to select all the records.

    My question is what are the limitations of the ListBox in VB6 (ie how many records can it take and how many records can be selected at one time with multiple select).

    Thanks
    Needaname16

  2. #2
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    a listbox can hold up to the length of an integer (or if someone else answers they can tell you unsigned or signed i dunno)

    i think the listview can go higher so use that instead.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    36276 i think is how much records it can hold, maybe 2 numbers changed around
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Yes it is maxed out at 32,735 or something like that. if you want to go higher then that then you need my Listbox.OCX. The only listbox(3rd Party or otherwise) i know of that can handle 2Million+ items.

    Download it Here

    Or Click the Link in my sig to read what all else it can do
    Last edited by Arc; Feb 15th, 2002 at 08:38 PM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  5. #5
    needaname16
    Guest
    Thanks for the replies.

    Needaname16.

  6. #6
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    ListView

    Use ListView, it's easy and more flexible and supports 2bilions lines (teory). You can use .MultiSelect, FullRowSelect, etc.

    Jefferson Motta

  7. #7
    needaname16
    Guest
    Thanks for the Replies,

    I have just looked into the ListView and are currently using it to get past my problem I just have a couple of questions:

    1) I could not find fullrowselect property in the Listview properties how do I get to this property?

    2) I notice with a lot of items in the ListView it takes a while for the form to unload. Is there a way I can use my status display to tell the user the progress of unloading the form?

    3) How can I put a combo box in a coloumn to allow the user to select an option for a particular record?

    Thanks for the Help

    Needaname16

  8. #8
    needaname16
    Guest

    Wink Please!!!!!!!!

    Surely someone knows how to do these things, I really need an answer to the 4th question (How do I put a combo box in one of the coloumns in the ListView?)

    Any Help is greatly appreciated.

    Needaname16

  9. #9
    Registered User
    Join Date
    Apr 1999
    Location
    Brazil
    Posts
    144

    Lightbulb ListView Tips

    '
    'You can Find an sample how edit text with ListView.
    'Change Text with ComboBox: lvsubitemedit.zip
    '

    '
    'Show in form status the unloading and use
    'LVWDeleteAllItems(ListView1.hWnd) to delete quickly using API
    '

    Private Const LVS_EX_FULLROWSELECT As Long = &H20

    Private Const LVM_FIRST As Long = &H1000
    Private Const LVM_SETEXTENDEDLISTVIEWSTYLE As Long = LVM_FIRST + 54
    Private Const LVM_GETEXTENDEDLISTVIEWSTYLE As Long = LVM_FIRST + 55
    Private Const LVM_DELETEALLITEMS As Long = (LVM_FIRST + 9)

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

    '
    'FullRowSelect you can find in MSComCtl.ocx or via API
    'It'll be available with View = lvwReport
    '

    Public Sub LVWFullRowSelect(ByVal hwnd As Long)

    On Error Resume Next

    Dim nLwRet As Long
    Dim nStyle As Long

    nStyle = SendMessage(hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, ByVal 0&)
    nStyle = nStyle Or LVS_EX_FULLROWSELECT
    nLwRet = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, ByVal nStyle)

    End Sub


    'Delete ALL ITENS via API

    Public Function LVWDeleteAllItems(ByVal hwnd As Long)
    SendMessage hwnd, LVM_DELETEALLITEMS, 0, 0
    End Function


    Good Luck!

    Jefferson Motta
    Attached Files Attached Files

  10. #10
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    just a tip:

    when typing code into a post please use "vbcode" tag at the start of the code and the "/vbcode" at the end of the code.

    it makes it much more readable. (and indents)

    ta.
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  11. #11
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by needaname16
    1) I could not find fullrowselect property in the Listview properties how do I get to this property?

    2) I notice with a lot of items in the ListView it takes a while for the form to unload. Is there a way I can use my status display to tell the user the progress of unloading the form?

    3) How can I put a combo box in a coloumn to allow the user to select an option for a particular record?
    1) Right click on the control and open the properties. It should be in a check box on the right side of the dialog. If not, check your version of MS Windows Common Controls.

    2) I think this was already answered?

    3) Search http://www.planet-source-code.com/ or these forums. They both have pretty good examples of adding controls to the ListView.
    My evil laugh has a squeak in it.

    kristopherwilson.com

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