Solved

Managing large text boxes

Posted on 1998-10-14
2
136 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
[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
2 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 100 total points
ID: 1439848
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
ID: 1439849
So simple, so effective. I forgot about the RTB

Thanks mate : )
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
clicking a shape in a frame array vb6 3 53
how to know if my Checkbox is True in VB6.0? 9 68
Help me. 3 77
Sub or Function is not defined 6 59
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

738 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