title: Validation in Windows form using c# in .net
body: <p>I am doing my project in VS2012 Windows Forms using C#.</p>
  
  <p>My probem is I am validating a textbox when the control loses focus; check it is empty or not. My textbox name is <code>ChildFirstName</code> and my code is:</p>
  
  <pre><code>private void ChildFirstName_Leave(object sender,EventArgs e)
  {
      if (ChildFirstName.Text == String.Empty)
      {
          ChildFirstName.Focus();
          ChildFirstName.ForeColor = Color.Red;
      }
  }
  </code></pre>
  
  <p>But this is not working can anybody say what is the actual problem?</p>