Click Star to Rate Post
This will open a textfile and then add the text contents to a textbox control using VB.NET, VB 2008, VB 2010, and Visual Basic 2013.
' 'Read from a text file to a textbox with the Stream Reader Class 'Put a textbox on the form and name txt and set to multi-line ' 'This will make the Reader read the entire contents of the textfile and write to the 'TextBox 'Create a new stream reader specifying its source to be from the newTextFile.txt file. Dim sReader As IO.StreamReader = New IO.StreamReader("c:\newTextFile.txt") ' 'Make the textbox keep the current data while adding the new data from the stream. txt.AppendText(sReader.ReadToEnd)