borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (save data into a text file?)Next Topic (input boxes) New Topic New Poll Post Reply
AndreaVB Forum : VB General : how to input text from a text file Solved Topic
Poster Message
hotsports
Level: Protégé

Registered: 18-03-2006
Posts: 7

icon how to input text from a text file

you will need to make
a textboc called "text1"
a command button called "cmdOpen"
a textfile

change multiline to true for the text box

'inputs text from a text file

Dim strline As String


Private Sub Form_Load()
Open ("(filename).txt") For Input As #1
end sub

Private Sub cmdOpen_Click()
Line Input #1, strline
text1.Text = strline
end sub

does any1 know how to save the inputed text file if u change it?




____________________________
[IMG]http://tinypic.com/m7b5tg.jpg[/IMG]

18-03-2006 at 01:52 AM
View Profile Send Email to User Show All Posts | Quote Reply
pavol
Level: Sage

Registered: 11-07-2005
Posts: 68
icon Re: how to input text from a text file

won't it just work if you print the text to it normally
like this:
Private Sub cmdSave_Click()
    Open filename.txt For Output As #1
    
    Print #1, text1.Text

    Close #1
End Sub

just something simple like that maybe.
hope it helps

____________________________
"Intellectuals solve problems, geniuses prevent them."
-Albert Einstein

Pavol

18-03-2006 at 04:55 PM
View Profile Send Email to User Show All Posts | Quote Reply
hotsports
Level: Protégé

Registered: 18-03-2006
Posts: 7
icon Re: how to input text from a text file

quote:
pavol wrote:
won't it just work if you print the text to it normally
like this:
Private Sub cmdSave_Click()
    Open filename.txt For Output As #1
    
    Print #1, text1.Text

    Close #1
End Sub

just something simple like that maybe.
hope it helps


that worked! thnx heaps man!


____________________________
[IMG]http://tinypic.com/m7b5tg.jpg[/IMG]
19-03-2006 at 03:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : how to input text from a text file Solved Topic
Previous Topic (save data into a text file?)Next Topic (input boxes) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder