title: c# How do i change the color of a specific textbox if it is empty?
body: <p>I am trying to change the color of an empty textbox, I have more than one textbox on this form and i wish to highlight the empty one when a user clicks submit. I have written the loop below which is in my btnSubmit function after checking if all the textbox have a value. Can anyone help in completing this loop for me??</p>
  
  <pre><code>foreach (Control txtbxs in this.Controls)
  {
      if (txtbxs is TextBox)
      {
          var TBox = (TextBox)txtbxs;
          if (TBox.Text == string.Empty)
          {
              TBox.ForeColor = Color.Red;
          }
      }
  
  }
  lblTopError.Text = "Please fill in the missing billing information";
  pnlTopError.Visible = true;
  </code></pre>