Solved

Overcoming textbox 32K limit

Posted on 2002-06-05
7
430 Views
Last Modified: 2007-12-19
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
Comment
Question by:BabyFace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Expert Comment

by:Toad224
ID: 7058221
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
 
LVL 17

Expert Comment

by:inthedark
ID: 7058346
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
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7058381
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!

 
LVL 8

Expert Comment

by:glass_cookie
ID: 7058502
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
 
LVL 2

Expert Comment

by:nahumd
ID: 7058624
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
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 7058828
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
 
LVL 1

Author Comment

by:BabyFace
ID: 7060558
Thanks,
that's the trick I need.
0

Featured Post

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question