title: Update different textBox depending on filename in C#
body: <p><br>
  I'm quite new to c# programming and I got myself a nice little problem now, and I would be very greatfull for some help.<br>
  I know that my example below isn't going to work, but it is just to give you an idea of what i'm trying to do.<br>
  The thing is that I want different textBoxes to be updated with the content of the file depending on the file name... So how do you assign textBox.text or textBox to something? </p>
  
  <pre><code>public void OnChanged(object source, FileSystemEventArgs e)
  {
     string newPath = Path.Combine(activeDir, "Files");
     string fileName = e.Name;
  
     if (fileName.StartsWith("O1"))
       TextBox txtBox = textBoxNC1;
     if (fileName.StartsWith("O2"))
       TextBox txtBox = textBoxNC2;
     if (fileName.StartsWith("O3"))
       TextBox txtBox = textBoxNC3;
     if (fileName.StartsWith("O7"))
       TextBox txtBox = textBoxNC4;
     if (fileName.StartsWith("O0"))
       TextBox txtBox = textBoxNC5;
  
     StreamReader rdr = new StreamReader(file);
     txtBox = rdr.ReadToEnd();
     rdr.Close();
  }
  </code></pre>
  
  <p>Sincerely<br>
  Hjalmarsson</p>