[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 140
  • Last Modified:

Managing large text boxes

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
StewartWood
Asked:
StewartWood
1 Solution
 
anthonycCommented:
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
 
StewartWoodAuthor Commented:
So simple, so effective. I forgot about the RTB

Thanks mate : )
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now