title: How to dynamically update Label text when textbox changes
body: <p>I am having a problem with updating the text of my label. Not sure how do I go about doing this. </p>
  
  <p>I have a label (lable1) and a text box (secondTextBox)and I have a tree view that the user needs to select items from. The process goes like this:</p>
  
  <p>User selects an element in the tree view, label1 displays default text and secondTextBox appears. When the user changes the default text inside secondTextBox the text inside label1 should automatically update itself without the user pressing anything (bear in mind that I have about 45 nodes that needs this to be active, is there a quick way to do this or do I have to edit the code for the 45 nodes?).</p>
  
  <p>So far I was able to do the first change, however whenever the user enters anything, the label doesn't update automatically, the user has to select something else from the tree view and goes back to the original selection for the text to update. </p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
      {
          if (treeView1.SelectedNode.FullPath == @"Node0/Node1")
          {
              label1.Text = String.Format("Whatever default text there is {0}"
       textBox1.Text);
          }
       }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here is the screen shot for when it is in default mode.</p>
  
  <p><a href="http://i.stack.imgur.com/0NOlP.jpg" rel="nofollow">http://i.stack.imgur.com/0NOlP.jpg</a></p>
  
  <p>Here is the screen shot for when I have entered text, but there is no change in the label box:</p>
  
  <p><a href="http://i.stack.imgur.com/3uX53.jpg" rel="nofollow">http://i.stack.imgur.com/3uX53.jpg</a></p>
  
  <p>Thank you very much in advance.</p>