Hi,
Now I am trying to read text from a text file and display it in a rich text box on my form. However nothing shows up in the box. I can select the file properly
(extension .fm6) but no text appears (I just have HELLO in the sample.fm6 file I'm using)
Here is a snippet of my code so far
Here is my form
Attachment 98805
Are there any clues as to where I'm going wrong? Thanks.
David
Now I am trying to read text from a text file and display it in a rich text box on my form. However nothing shows up in the box. I can select the file properly
(extension .fm6) but no text appears (I just have HELLO in the sample.fm6 file I'm using)
Here is a snippet of my code so far
Code:
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
Changed = True 'I don't know what to put here?
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
' Displays an OpenFileDialog so the user can select a Cursor.
Dim openFileDialog1 As New OpenFileDialog()
openFileDialog1.Filter = "Matrix Files|*.fm6"
openFileDialog1.Title = "Select a Matrix File"
If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
' Assign the cursor in the Stream to the Form's Cursor property.
Dim extension = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("."))
If extension Is "fm6" Then
'RichTextBox1.Text = FileIO.FileSystem.ReadAllText(openFileDialog1.FileName)
CurrentFile = openFileDialog1.FileName
RichTextBox1.LoadFile(CurrentFile)
Me.Text = CurrentFile
Changed = False
End If
End If
End Sub
End Class
Attachment 98805
Are there any clues as to where I'm going wrong? Thanks.
David