i wont a text file to load into a rich text on box on load , then save when the form closes. my problem has been creating the text file , i am very new for visual basic and could use some help this is my attempt on this.
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
RichTextBox1.Lo adFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
On Error Resume Next
RichTextBox1.Sa veFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
End Sub
Private Sub Form1_FormClosi ng(ByVal sender As Object, ByVal e As System.Windows. Forms.FormClosi ngEventArgs) Handles Me.FormClosing
RichTextBox1.Sa veFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
when the form is opened for the first time the file has not been created , i thought the the on error resume next would skip it to the next line so the file is created , but not overwritten every time the program is opened .
as i said i am very new to visual basic so please correct or even tell me what i tired to do was rubbish but please help would be very welcome
thanks for your time/help
Rob
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
RichTextBox1.Lo adFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
On Error Resume Next
RichTextBox1.Sa veFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
End Sub
Private Sub Form1_FormClosi ng(ByVal sender As Object, ByVal e As System.Windows. Forms.FormClosi ngEventArgs) Handles Me.FormClosing
RichTextBox1.Sa veFile("C:\Outp utFolder\lol", RichTextBoxStre amType.PlainTex t)
when the form is opened for the first time the file has not been created , i thought the the on error resume next would skip it to the next line so the file is created , but not overwritten every time the program is opened .
as i said i am very new to visual basic so please correct or even tell me what i tired to do was rubbish but please help would be very welcome
thanks for your time/help
Rob
Comment