Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which holds more data: Textbox, Listbox, FlexGrid or Other?

Status
Not open for further replies.

tyhand

Programmer
Jul 3, 2002
186
0
0
US
Hey all,

I'm writing a small program that requires enough flexibility to hold over 20,000 lines of text/data in each Text Box field.

So far, I'm using plain Textboxes for this; but unfortunately I keep getting Overflow Errors with anything over 1000 lines of text/data.

I'm wondering if perhaps it's better to use a ListBox or FlexGrid instead.... maybe even a RichTextBox.

By the way, I can't say for sure why I'm getting the OverFlow errors. I'm using arrays (as strings) to store the data from the Textboxes. I suspect it's a limitation on the Textbox, but I can't be sure.

Thoughts, comments, suggestions, and insights are welcome.

Thanks!

- Tyhand
 
I'm not sure why you'd consider a list or grid comntrol as an alternative. Perhaps the textbox wasn't what you wanted in the first place?

Edit and for that matter RichEdit controls are not primarily used for display purposes, though they can be. List and grid controls have their own purposes, but they also have a lot more overhead.

Of course things we'd never consider when VB6 was new are probably practical now. Most computers aren't limited to 4M to 12M of RAM the way they used to be!


Many of the design decisions made when Edit and RichEdit were created was based on some assumptions about the amount of text they'd typically hold. If you shove enough text into them you'll notice that some operations become very slow because massive amounts of data have to be moved around.
 
>Many of the design decisions made when Edit and RichEdit were created ...

Many of the design decisions made for VB's version of Edit and RichEdit were created ...

As I have previously pointed out, the underlying controls can both handle 4Gb of data, if you really insist ...
 

"to hold over 20,000 lines of text/data in each Text Box field." seams to me like A LOT of data to give to the User to deal with.

If you explain in more details what you are trying to accomplish - there could/should/must be a better way to do it.


Have fun.

---- Andy
 
Hey all,

Thanks for the replies.

To be sure, I'm updating a program I wrote several years back when I was first learning vb6. Though my programming skills have improved over the years, I'm still sort of a newbie with vb6.

The purpose of the program is to take large groups of words and phrases - and then perform functions on them.

I first used the Text Box control simply because it was all I knew how to use at the time.

I'm thinking perhaps using a database (or database controls) will be more suited for my purposes; however I'm trying to avoid this option - which is why I'm asking for help.

I read the thread dilettante suggested, but can't be sure about a fix to the overflow error I keep getting.

Any further thoughts?

Thanks again for the help.

- Tyhand

 
>a fix to the overflow error I keep getting

Perhaps you can give us more information, and then we might be able to advise.
 
I would keep the data in a string or an array and only show on the text box a portion of the data.
Eg. if the text was contained in MyString you would show a 100 bytes of the middle of it using
text1.text = mid(MyString, StartPos, 100)

if each line was an element of an array I would use
Text1.text = ""
For a=StartPos to StartPos + 100
Text1.text = Text1.text & MyString(a)
Next

Vary StartPos with a slider & redo the routine to show different parts of the data

If editing you would need a Save button to save any changes and replace the section of data text with the textbox text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top