Solved

Overcoming textbox 32K limit

Posted on 2002-06-05
7
414 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 40
Sending a email via excel using vba 6 97
Sorting multiple rows and columns, and count duplicates in Excel 2013 4 87
Child Form in front 4 49
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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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