title: create generic LostFocus event handler in c#
body: <p>Here is the situation:</p>
  
  <p><a href="http://i962.photobucket.com/albums/ae103/kashyaprakesh/misc/denominationwindow.jpg" rel="nofollow noreferrer">http://i962.photobucket.com/albums/ae103/kashyaprakesh/misc/denominationwindow.jpg</a></p>
  
  <p>I have text boxes to left which accepts denomination values and other text box to right gives the total value for eg. in 1000's label's left textbox if I put value as 5 then to right the value is 5000.</p>
  
  <p>I used lostFocus event handler to do this, but is it necessary to do the lost focus event handler for each and every textbox? There will surely be an other way.</p>
  
  <pre><code> private void textBox6_Leave(object sender, EventArgs e)
   {
          MessageBox.Show(e.ToString());
          if (textBox6.Text == "")
          {
              string y = "0";
              textBox6.Text = y;
              textBox8.Text = y;
          }
          else
          {
              textBox8.Text = populateTotalAmount(textBox6.Text, 1000);
  
          }
          textBox8.ReadOnly = true;
      }
  
      private string populateTotalAmount(string denominations, int value)
      {
          int totalVal = Int32.Parse(denominations) * value;
          return totalVal.ToString();
      }
  </code></pre>
  
  <p>I would like to create a generic event handler which works on <code>LostFocus</code> event and also I need to pass different value(ie, 500,100, etc etc etc)
  so that I can use that value to send it <code>populateTotalAmount</code> function.</p>