Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Visual Studio List Box with 1,000,000 entries / Who else noticed this capacity?

Visual Studio List Box with 1,000,000 entries / Who else noticed this capacity?

Scheduled Pinned Locked Moved Visual Basic
questioncsharpc++visual-studioalgorithms
16 Posts 5 Posters 89 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    Member 15078716 wrote:

    Who else has noticed this capacity?

    I have never had a need to put that many in. The limits on most similar controls is usually available memory, so if you can get that many in it merely proves what good job Microsoft did in creating the control.

    Member 15078716 wrote:

    Does the latest version of Visual Studio have this capacity for it's listbox?

    This has nothing to do with Visual Studio. A ListBox is a Windows control.

    M Offline
    M Offline
    Member 15078716
    wrote on last edited by
    #7

    @Richard MacCutchan, I bow to your wisdom. Much of what I have done in programming after I retired has been based upon studing your postings. Maybe it is a holdover from my working days, but I still occationally test what I am working with. Thank you.

    1 Reply Last reply
    0
    • L Lost User

      You didn't put it "in a listbox"; you created a collection with a million entries; entries which could be anything. A "listbox" is a "visual"; it "simulates" what you think you see; it's not "real"; the collection is what's "real". You have a collection that consumes memory based on the size of the entries; that's it. And at some point, once a collection is big enough, the system starts "paging"; and if there is not enough memory, it starts thrashing. That's where the performance, or lack thereof, comes in.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      M Offline
      M Offline
      Member 15078716
      wrote on last edited by
      #8

      @Gerry Schmitz, I had wondered if that was the case, when I did the test. I had wondered, while using Visual Studio (almost exclusively) for programming, if I could code a sort routine that was as fast as the listbox sort was. I was wanting the ability to sort a large amount of data without using a pre-built database. I was also attempting to keep my executable file to a minimum size, while being able to use it on a Windows computer that did not have VS installed. I tested some and liked the listbox sort. I accidently input beyond what I was told the listbox could hold, and it still sorted correctly, and fast. So, somewhere the limit was not actually the limit. Thus, I tested, with increasing amounts until I found that a listbox could be used by me as a sorting process with over one million entries. Search for a sort that is as fast as a listbox for my vast entries was over. I call it a listbox, but I know that there is no box and it is all some binary switching via Insulated Gate Bypolar Transistors. Thank you for sharing your wisdom. I hope to have learned from it. Or, could that be trinary switching since the insulated gate is simply an updated switch from the days of previous transistor designs. Or, could it be quadnary switching since ... So much to ask. Maybe a different question for that. Maybe a phD in semi-conductor circuit design electronic component engineering would know that. Thank you.

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I never said testing the limits of the controls was irrelevant. Those are technical limits. Using the controls is subject to the usability limits of users. Sure, you can put a million items in a listbox. Now what? Putting a million items in a control is putting your users through navigation hell. Are you seriously going to expect users to search through that many items to find the one, or more, they want? If you don't code for the limits of your users, they uninstall your app. Technical limits are only one aspect of the "limits" you should be concerned about.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        M Offline
        M Offline
        Member 15078716
        wrote on last edited by
        #9

        @Dave Kreskowiak, your wisdom about focusing on users I accept. I explained in a different reply (to Gerry Schmitz) in this thread why I wanted the sort and what I had discovered. The list and the sort would not necessarily be for the user to see, but for my internal use. And, by using a list box sort I did not have to include a sort of my own in code and could keep the final file size smaller. Microsoft has some very nice code already written that behind the scenes does some amazing things fast. I used their years of experience and army of coders to speed up my program and lessen the final size of it. But, I was still left with the question of "How did they do that?" So, now I am attempting to devour C and C++ as fast and as thoroughly as I can. Read, study, code, try not to pull out hair, ask here, repeat. Thank you.

        1 Reply Last reply
        0
        • M Member 15078716

          @Gerry Schmitz, I had wondered if that was the case, when I did the test. I had wondered, while using Visual Studio (almost exclusively) for programming, if I could code a sort routine that was as fast as the listbox sort was. I was wanting the ability to sort a large amount of data without using a pre-built database. I was also attempting to keep my executable file to a minimum size, while being able to use it on a Windows computer that did not have VS installed. I tested some and liked the listbox sort. I accidently input beyond what I was told the listbox could hold, and it still sorted correctly, and fast. So, somewhere the limit was not actually the limit. Thus, I tested, with increasing amounts until I found that a listbox could be used by me as a sorting process with over one million entries. Search for a sort that is as fast as a listbox for my vast entries was over. I call it a listbox, but I know that there is no box and it is all some binary switching via Insulated Gate Bypolar Transistors. Thank you for sharing your wisdom. I hope to have learned from it. Or, could that be trinary switching since the insulated gate is simply an updated switch from the days of previous transistor designs. Or, could it be quadnary switching since ... So much to ask. Maybe a different question for that. Maybe a phD in semi-conductor circuit design electronic component engineering would know that. Thank you.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #10

          The listbox doesn't "sort" either; that's the job of the collection. You think it's sorting because that's where the interface is. The person in the drive-thru window doesn't actually make the burger; someone else does and passes it back.

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          M CHill60C 2 Replies Last reply
          0
          • L Lost User

            The listbox doesn't "sort" either; that's the job of the collection. You think it's sorting because that's where the interface is. The person in the drive-thru window doesn't actually make the burger; someone else does and passes it back.

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            M Offline
            M Offline
            Member 15078716
            wrote on last edited by
            #11

            @Gerry Schmitz, very nice analogy.

            1 Reply Last reply
            0
            • L Lost User

              The listbox doesn't "sort" either; that's the job of the collection. You think it's sorting because that's where the interface is. The person in the drive-thru window doesn't actually make the burger; someone else does and passes it back.

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              CHill60C Offline
              CHill60C Offline
              CHill60
              wrote on last edited by
              #12

              Fantastic analogy actually. I'm stealing it! :laugh:

              1 Reply Last reply
              0
              • M Member 15078716

                I am not using Visual Studio these days. I use C and C++, or at least I am trying to learn to use C and C++. I remember putting over 1,000,000 entries into a listbox and then being able to read all of them back. I also remember the listbox sorting that entire 1,000,000 entries correctly. Who else has noticed this capacity? And, as a follow up question: Does the latest version of Visual Studio have this capacity for it's listbox? Thank you.

                CHill60C Offline
                CHill60C Offline
                CHill60
                wrote on last edited by
                #13

                To answer your follow up question:

                Quote:

                Does the latest version of Visual Studio have this capacity for it's listbox?

                The "capacity" of any single object in .NET is 2GB as defined by the CLR. In theory you can extend this at runtime - see gcAllowVeryLargeObjects element - .NET Framework | Microsoft Docs[^] I see you are not using the ListBox as a visual control per se but utilising it for its sorting capability - in which case just use a List and List<T>.Sort Method (System.Collections.Generic) | Microsoft Docs[^]

                M 1 Reply Last reply
                0
                • CHill60C CHill60

                  To answer your follow up question:

                  Quote:

                  Does the latest version of Visual Studio have this capacity for it's listbox?

                  The "capacity" of any single object in .NET is 2GB as defined by the CLR. In theory you can extend this at runtime - see gcAllowVeryLargeObjects element - .NET Framework | Microsoft Docs[^] I see you are not using the ListBox as a visual control per se but utilising it for its sorting capability - in which case just use a List and List<T>.Sort Method (System.Collections.Generic) | Microsoft Docs[^]

                  M Offline
                  M Offline
                  Member 15078716
                  wrote on last edited by
                  #14

                  Thank you Thank you Thank you. Your answer is so valid. looks good. But I was just wondering if someone had noticed the VS ListBox capacity was way beyond advertised. I do not use Visual Studio or Visual Basic or Visual Java at this time. I do not program with .NET at this time. I do not use DirectX in my programming at this time. I am retired and I am attempting to learn C and C++ without the help of those helpers. I do not even use boost. I am trying to become a real C and C++ programmer. Thank you for your offer of a solution. It looks like what I might have used before I retired. It looks like solid code. But, even though I thank you I can not use it. Thank you.

                  V 1 Reply Last reply
                  0
                  • M Member 15078716

                    Thank you Thank you Thank you. Your answer is so valid. looks good. But I was just wondering if someone had noticed the VS ListBox capacity was way beyond advertised. I do not use Visual Studio or Visual Basic or Visual Java at this time. I do not program with .NET at this time. I do not use DirectX in my programming at this time. I am retired and I am attempting to learn C and C++ without the help of those helpers. I do not even use boost. I am trying to become a real C and C++ programmer. Thank you for your offer of a solution. It looks like what I might have used before I retired. It looks like solid code. But, even though I thank you I can not use it. Thank you.

                    V Offline
                    V Offline
                    Victor Nijegorodov
                    wrote on last edited by
                    #15

                    Then have a look at [std::list - cppreference.com](https://en.cppreference.com/w/cpp/container/list) It has nothing to do with .NET. It has nothing to do with Visual Studio. It is standard container in C++.

                    M 1 Reply Last reply
                    0
                    • V Victor Nijegorodov

                      Then have a look at [std::list - cppreference.com](https://en.cppreference.com/w/cpp/container/list) It has nothing to do with .NET. It has nothing to do with Visual Studio. It is standard container in C++.

                      M Offline
                      M Offline
                      Member 15078716
                      wrote on last edited by
                      #16

                      Thank you. Your wisdom is appreciated.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups