title: How do I show a directory path in a textbox when selected by the user?
body: <p>First, I am using Visual Studio 2013 and coding in C# to develop a Windows Form Application.  I have added the "System.IO" namespace.</p>
  
  <p>I need to show a directory path in a textbox when selected by the user.
  The code works correctly to where the user selects a folder from a popup
  and presses the OK button, which then displays the number of files within 
  that folder -- but the folder path does NOT get displayed as I desired.</p>
  
  <p>Code looks like this:</p>
  
  <pre><code>   private void button1_Click(object sender, EventArgs e)
      {
          //
          // This event handler was created by clicking the button in the application GUI.
          //
          DialogResult button1_Click = folderBrowserDialog1.ShowDialog();
          if (button1_Click == DialogResult.OK)
          {
              //
              // The user selected a folder and pressed the OK button.
              // A message pops up and identifies the number of files found within that folder.
              //
              string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);
              MessageBox.Show("Files found: " + files.Length.ToString(), "Message");
          }
      }
      private void textBox1_TextChanged(object sender, EventArgs e)
      {
          string path;
          path = folderBrowserDialog1.SelectedPath;
          // folderBrowserDialog1.ShowDialog(); // NOT SURE ABOUT USING THIS!
          textBox1.Text = path;
      }
  </code></pre>