I don't know why you are reading the bytes now suddenly instead of the text, but here is what I think you want:
vb.net Code:
'Put this at the top of your form class (right after "Public Class <formname>")
'This is the variable that will hold the text
Dim strText As String
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If Me.OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
'Here we assign the text of the file to the string variable
strText = IO.File.ReadAllText(OpenFileDialog1.FileName)
End If
End Sub
The 'Dim strText As String' line should be right at the top (and not in the Button4_Click event sub) because we want it to be a public variable instead of a local variable. That means that any sub in the current form can access (read and write) that variable, just like you can with a textbox.
If you now want to use the text you use this variable:
Let's say you want to replace all spaces in the text with dots for example:
vb.net Code:
strText = strText.Replace(" ", ".")
That is all. So basically instead of using your textbox to store the string, you are now using a public variable.