Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Feeding a textt file into a text box......? 2

Status
Not open for further replies.

RSTR

Programmer
Mar 25, 2000
27
US
I have code written to open a text file and feed it into a text box... <br><br>However, I cannot get a new line to return and start a new line <br><br>for example:<br><br><br><br>line 1....<br>line 2....<br>line 3...<br><br>turns out looking like:<br>line1.... line2.... line3.....<br><br><br>How can I get it to start a new line?
 
vbCLRF i think is the constant that makes a carridge return in a TextBox(or load file into a RichText box which does formating for you) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
vbCLRF doesn't work.<br><br>I might be doing it wrong:<br><br>do while not eof(1)<br>line input #1, Lfeed<br>text1.txt = text1.txt + Lfeed + vbCLRF<br>loop<br><br>
 
You also need to set the multiline attribute for the text box. If you do have a vbCrLf inserted to start a new line, but the multiline attribute is false you will get a couple of parallel lines in the text for each crlf and it will not start a new line.<br>
 
MultiLine must be True. You can avoid appending VbCrLf to each line by reading the entire text file as one record.<br><br>FF=Freefile<br>Open &quot;MyFile.txt&quot; for Binary as #FF<br>ReadText$ = String$(Lof(FF), 32)<br>Get #FF, 1, ReadText$<br>Close #FF<br>Text1.Txt = ReadText$<br><br>It's a little quicker. <p> <br><a href=mailto: > </a><br><a href= temporary Vorpalcom home page</a><br>Send me suggestions or comments on my current software project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top