Solved

Overcoming textbox 32K limit

Posted on 2002-06-05
7
401 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Check Disk (CHKDSK) on all volumes and fix if needed. 8 178
How to Add / Edit Windows Menu 4 51
Passing a Text Box name to a Sub 6 74
Child Form in front 4 37
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now