I would imagine that you need to read through the document one line at a time until you get to a certain one. Either know the line number (and use a loop to iterate through) or use a general expression to find the text, if you do not know the line number.
public static void Main()
// Create an instance of StreamReader to read from a file.
// The using statement also closes the StreamReader.
using (StreamReader sr = new StreamReader("TestFile.txt"))
// Read and display lines from the file until the end of
// the file is reached.
while ((line = sr.ReadLine()) != null)
catch (Exception e)
// Let the user know what went wrong.
Console.WriteLine("The file could not be read:");
You should be able to modify the while loop to go to the specific line number. Just execute sr.ReadLine() that many times until you get to your line.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...