Solved

Overcoming textbox 32K limit

Posted on 2002-06-05
7
390 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 8

Expert Comment

by:glass_cookie
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks,
that's the trick I need.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 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

11 Experts available now in Live!

Get 1:1 Help Now