It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Read/Write Data

Moderator: dafunkymunky

Read/Write Data

Postby cogbuehi on Tue Apr 01, 2008 1:29 pm

I need help creating a program that accepts up to 500 characters of text and then writes it to a disk data file. There should be a popup that tells the user the data was written to the file successfully. Once the data is written, i need a button that reads the data file and displays the text in a second textbox.
cogbuehi
 
Posts: 2
Joined: Tue Mar 25, 2008 3:59 pm

Postby egendapoco on Tue May 06, 2008 1:48 am

Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
richtextbox1.maxlength = (500)

End Sub
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.click
Dim path As String = "text.txt"
RichTextBox1.SaveFile(path)
End Sub

Private Sub button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button2.click
Dim path As String = "text.txt"
RichTextBox2.LoadFile(path)
MessageBox.Show("The file was sucessfully saved", "Sucessful", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
egendapoco
 
Posts: 0
Joined: Tue May 06, 2008 1:31 am


Who is online

Users browsing this forum: No registered users and 4 guests