title: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
body: <p>I created a class called Checker. This is the code:</p>
  
  <pre><code>namespace WindowsFormsApplication1
  { 
      public class Checker
      {
          int CheckAdminEdit(Object Temp,int counter,int allow)
          {
              int _counter = counter;
              int _allow = allow;
              Admin _Temp = Temp as Admin;
  
              foreach (Control c in _Temp.edit_admin.Controls)
              {
                  if (c is TextBox)
                  {
                      TextBox textBox = c as TextBox;
                      if (textBox.Text.Equals(string.Empty))
                      {
                          _Temp.errorProvider1.SetIconPadding(textBox, 0);
                           _Temp.errorProvider1.SetError(textBox, "Field Empty");
                          _allow++;
                      }
                      else
                      {
                          _Temp.errorProvider1.SetIconPadding(textBox, 666);
                          if (textBox.Name == "textBox6")
                          {
                              if( CheckEmail(textBox.Text))
                                  _Temp.errorProvider2.SetIconPadding(textBox, 666);
                              else
                              {
                                  _Temp.errorProvider2.SetError(textBox, "Invalid email syntax");
                                  _counter++;
                              }
                          }
                      }
                  }
              }
  
              return (allow + counter);
          }
  
          private bool CheckEmail(string EmailAddress)
          {
              string strPattern = "^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})$";
  
              if (System.Text.RegularExpressions.Regex.IsMatch(EmailAddress, strPattern))
                  return true;
  
              return false;
          }
      }
  }
  </code></pre>
  
  <p>and in my form I'm trying to declare the class with :</p>
  
  <pre><code>Checker try = new Checker;
  </code></pre>
  
  <p>but the first Checker in underlined also the try the = sign and the ; sign saying that Only assignment, call, increment, decrement, and new object expressions can be used as a statement. Sorry if this is hard to understand, but I'm very thankful to those who can help:D</p>