Solved

Managing large text boxes

Posted on 1998-10-14
2
130 Views
Last Modified: 2010-08-05
Hello! I have found while populating a text box with code similar to :

  Dim filename As String
  filename = "c:\large.txt"
  Open filename For Input As #1
  Dim x As Variant
  Do While Not EOF(1)
    Line Input #1, x
    textbox.Text = textbox.Text + x + vbCrLf
  Loop
Close #1

that handling 1000+ lines causes the program to lock up (predicatably) Does anyone has a nice bit of code which allows a routine to read in say 100 lines then detects manages the population of the rest of the file buy scroll or page up/down etc actions?  

Cheers

Stewart Wood
0
Comment
Question by:StewartWood
2 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 100 total points
Comment Utility
A text box can only hold 32K of text (64K of storage, but in unicode, 1 character is 2 bytes).  You are probably locking up when you hit that bound.

Use a rich text box, and you can do what you want without problems.
0
 

Author Comment

by:StewartWood
Comment Utility
So simple, so effective. I forgot about the RTB

Thanks mate : )
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now