|
-
Nov 3rd, 2002, 06:57 PM
#1
Thread Starter
Lively Member
Can you.... * RESOLVED *
Can you..
load the contents of a .txt file into a normal text box? IE. NOT a rich text box. Just the normal one or does it have to a a rtb? If you can do it with a normal text box please reply with how.
Last edited by DanC2k2; Nov 3rd, 2002 at 07:10 PM.
-
Nov 3rd, 2002, 07:02 PM
#2
Hyperactive Member
You can load it into the text box, just not the formatting...
VB Code:
Private Sub Form_Load()
Dim CurrentLine As String
Open App.Path & "\FILENAME.txt" For Input As #1
Do Until EOF(1)
Line Input #1, CurrentLine
text1.Text = text1.Text & vbNewLine & CurrentLine
Loop
Close #1
End Sub
make a text box (text1) and make sure it is mulitline.
-
Nov 3rd, 2002, 07:06 PM
#3
Thread Starter
Lively Member
-
Nov 3rd, 2002, 07:06 PM
#4
Software Eng.
Here's another method.
Code:
Open "Myfile" for Input As #1
Text1.Text = Input(LOF(1),1)
Close #1
-
Nov 3rd, 2002, 07:19 PM
#5
Hyperactive Member
Megatron's works as well, however, I think my way is better for experience, as it gives you the basic method of how to read a file and actually use it in various ways...
-
Nov 4th, 2002, 12:26 PM
#6
Thread Starter
Lively Member
now now, no need to fight over helping me
-
Nov 4th, 2002, 12:28 PM
#7
So Unbanned
Originally posted by kandieman101
Megatron's works as well, however, I think my way is better for experience, as it gives you the basic method of how to read a file and actually use it in various ways...
I use Megatron's method.
Well, the method he stated, I used it before he said it here....
Yeah....
Only one thing. I open for binary. It's faster.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|