title: Fields validation in winforms
body: <p>Is there a shortcut in validating fields in winforms? For example a particular textBox is required to be filled up before saving a record. What I always do is I check first all the required fields programatically before saving. Example:</p>
  
  <pre><code>protected bool CheckFields()
  {
      bool isOk = false;
      if(textBox1.Text != String.Empty)
        {
            isOk = true;
        }
      return isOk;
  } 
  
  private void btnSave_Click(object sender, EventArgs e)
  {
      if(CheckFields())
        {
            Save();// Some function to save record.
        }
  }
  </code></pre>
  
  <p>Is there a counter part of Validator in ASP.Net in winforms? Or any other way around...</p>