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:
  1. 'Put this at the top of your form class (right after "Public Class <formname>")
  2. 'This is the variable that will hold the text
  3. Dim strText As String
  4.  
  5. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  6.         If Me.OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  7.             'Here we assign the text of the file to the string variable
  8.             strText = IO.File.ReadAllText(OpenFileDialog1.FileName)
  9.         End If
  10.     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:
  1. strText = strText.Replace(" ", ".")

That is all. So basically instead of using your textbox to store the string, you are now using a public variable.