title: How can I compare two text boxes?
body: <p>I am trying to compare two text boxes to see if they are empty but I get an exception error:</p>
  
  <blockquote>
    <p>Input string was not in a correct format</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>private void btncalc_Click(object sender, EventArgs e)
  {
      try
      {
          int ina= int.Parse(txttea.Text);
          int inb= int.Parse(txtcoffee.Text);
          int inc = 0, ind = 0;
          if (this.txttea.Text == "" &amp;&amp; this.txtcoffee.Text == "")  // this not working
          {
              MessageBox.Show("select a item");
              txttea.Focus();
          }
          if (cbxwithoutsugar.Checked)
          {
              inc = (ina * 20);
          }
          else
          {
              inc = (ina * 8);
          }
          if (cbxcoldcoffee.Checked)
          {
              ind = (inb * 10);
          }
          else
          {
              ind = (inb * 5);
          }
          txtamount.Text = (Convert.ToInt32(inc) + Convert.ToInt32(ind)).ToString();
      }
      catch (Exception a)
      {
          MessageBox.Show(a.Message);
      }
  }
  </code></pre>