[RESOLVED] TextBox questions
hello guys :wave:
I have two questions about textbox component...
1 - which is the maximum length and (if possible) how we can expand it?
2 - how to disable the vertical scrollbar of a multiline textbox while we are opening text files? usefull to speed up the opening process
Thanks!
Re: [RESOLVED] TextBox questions
Thanks for the informations koolsid!
Re: [RESOLVED] TextBox questions
To speed up opening process you should give the textbox the whole file at once. This means you should build up a string to put in the textbox.
The easiest way to read a whole file at once:
Code:
Open Filename For Input As #1
Text1.Text = Input(LOF(1), #1)
Close #1
If you need to do other processing and thus can't read a file directly, do not use Text1.Text = Text1.Text & Something! This will be very slow. Use a string variable instead.
Re: [RESOLVED] TextBox questions
Quote:
Originally Posted by Merri
To speed up opening process you should give the textbox the whole file at once. This means you should build up a string to put in the textbox.
The easiest way to read a whole file at once:
Code:
Open Filename For Input As #1
Text1.Text = Input(LOF(1), #1)
Close #1
If you need to do other processing and thus can't read a file directly, do
not use
Text1.Text = Text1.Text & Something! This will be very slow. Use a string variable instead.
Thanks for the tips Merri, and very nice website btw ;)
Re: [RESOLVED] TextBox questions
Last question...
Does anyone knows an alternative component without that 32.000 characters limitation?
I'm looking for a component which can deal with huge data
Thanks!
Re: [RESOLVED] TextBox questions
You could consider using Richtextbox instead.
Re: [RESOLVED] TextBox questions
However, at few megabytes RTB gets pretty slow and sluggish. You'd need to be able to have a component that doesn't load the entire file to memory at once, instead reads just the scroll positions and keeps track of any changes made so that it'll display things correctly. Doing only reading display is pretty easy, going for the editing business is the hard part.
UniText that I've made can also show more than 32768 characters.
Re: [RESOLVED] TextBox questions
Actually the text box control can hold over 32K it just can't load it. You can do it however through the API. Check this link:
http://www.planet-source-code.com/vb...69294&lngWId=1
Re: [RESOLVED] TextBox questions