ListBox
-
After you all sorting out my problem with adding strings to a listbox, I now have a few more questions about them: Is ther a limit to the amount of strings that can be added to a ListBox? My application will run indefinitly, so could end up having a huge amount of text entered into it - will this be a problem? If it is, is there an easy way to limit the amount of strings, so that if you enter more into the ListBox, the first ones (oldest) will fall off the List? Thansk for all your help Mike
-
After you all sorting out my problem with adding strings to a listbox, I now have a few more questions about them: Is ther a limit to the amount of strings that can be added to a ListBox? My application will run indefinitly, so could end up having a huge amount of text entered into it - will this be a problem? If it is, is there an easy way to limit the amount of strings, so that if you enter more into the ListBox, the first ones (oldest) will fall off the List? Thansk for all your help Mike
I think the limit is either 16000 or 32000 strings. I seem to remember seeing a virtual list box article on CP somewhere. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-
I think the limit is either 16000 or 32000 strings. I seem to remember seeing a virtual list box article on CP somewhere. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Thanks John I just did an experiment with my app, and it hung once I had written 32736 lines into it! In a normal day, I shouldnt be adding more than 100 lines of text a day to the ListBox, so that would mean i could run the app for approx 1 year before this would become an issue. Still, it would be nice to block the problem from happening... Thanks again Mike
-
Thanks John I just did an experiment with my app, and it hung once I had written 32736 lines into it! In a normal day, I shouldnt be adding more than 100 lines of text a day to the ListBox, so that would mean i could run the app for approx 1 year before this would become an issue. Still, it would be nice to block the problem from happening... Thanks again Mike
as john suggested, use a virtual listbox ... search this site on how to do it; it's not at all complicated ...
Maximilien Lincourt Your Head A Splode - Strong Bad
-
Thanks John I just did an experiment with my app, and it hung once I had written 32736 lines into it! In a normal day, I shouldnt be adding more than 100 lines of text a day to the ListBox, so that would mean i could run the app for approx 1 year before this would become an issue. Still, it would be nice to block the problem from happening... Thanks again Mike
LB_ADDSTRING
returnsLB_ERRSPACE
if the list is full. You can then delete the oldest item and add the new one. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ -
Thanks John I just did an experiment with my app, and it hung once I had written 32736 lines into it! In a normal day, I shouldnt be adding more than 100 lines of text a day to the ListBox, so that would mean i could run the app for approx 1 year before this would become an issue. Still, it would be nice to block the problem from happening... Thanks again Mike
Do you really want to wade through several thousand items in the listbox? Why not create a circular list (i.e., older items get replaced by newer items) that only holds a small amount of items? The listbox could then show the contents of this list.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli