• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

Overcoming textbox 32K limit

Hi,
I need to display more than 32K of text in a textbox. The standard one is limited to 32K, and the rich textbox doesn't have the same scroll bar behaviour as the regular textbox which I need. (Both scroll bars.) Is there a way I could get the standard textbox to hold more than 32k? If not can someone suggest a work around?

Thanks.
0
BabyFace
Asked:
BabyFace
1 Solution
 
Toad224Commented:
In Win2000, and WinXP, I believe a standard textbox can hold more than 32K.  I do not believe there is a standard way of making a textbox hold more than 32k in previous versions of windows.

Good luck!
0
 
inthedarkCommented:
You could try the richtextbox control.

To get over this limitation I created a my own user control which used a picture box and trapped all of the keyboard events.  I used the textwidth function to decide where to display the information and loads of API calls to make the caret work.  After a week of effort I had a control that could load and edit a text file.  The first time I wrote the code I made a mistake and used Object Classes for each word like MS Words does, but this was slow to load a large file.  I rewrote the code to use arrays of UDTs (User Defined Types) and now the code can load, display  and edit a text file of 1MB in just 0.020 seconds which is 5600% faster than Word for Windows.  I am forever amazed with what VB can do.

Happy coding.....
0
 
Anthony PerkinsCommented:
There is no way around it, that I know of.  Just so that we are on the same wave length, it should be clarified that you can input more than 32K, you cannot add (or assign) more than 32K.  As inthedark has suggested RichTextbox is the way to go.

Anthony
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
glass_cookieCommented:
Hi!

How about using more than 1 textbox to display the data.

Simply do something like using buttons with captions page1/2, page 2/2... on your window.

In other words, refuse to show the other remaining whatever-32 KB of text unless the user clicks on a button or something.

You could use the mid() function to split the text : )

That's it!

glass cookie : )
PS.I thought the limit was around 50KB++
0
 
nahumdCommented:
Listening....

p.s.
A workaround that I've just thought about that might help:
Put another vertical scroll bar next to the textbox, and pressing it up/down will present another portion of the textbox.
0
 
TimCotteeCommented:
The Richtextbox control can have both horizontal and vertical scrollbars. To get the horizontal one just set the .RightMargin property greater than the width of the control:

    RichTextBox1.RightMargin = RichTextBox1.Width * 2

Will then allow the horizontal scrollbar to be displayed if the content requires it.
0
 
BabyFaceAuthor Commented:
Thanks,
that's the trick I need.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now