title: C# Temperature Conversion Form
body: <p>I have this form to due for a school class i am in.  Im having trouble running the program.  Here are the requirements:</p>
  <ul>
  <li><p>When the user clicks the button to convert, the first step is to validate   the user input in the textbox. Any real number is acceptable. If the user input in the textbox is not a real number, display an appropriate message in the results output label as follows.
  “ERROR: Please enter a numeric temperature to convert.”</p>
  </li>
  <li><p>If the user input is a real number, store it, then calculate the converted temperature value based on the “convert to” radio button selected. Then display the results in the output label. Follow this example for the appropriate format:
  “72.4 degrees Fahrenheit converts to 22.44 degrees Celsius.”</p>
  </li>
  <li><p>When the user clicks the button to clear, the form should be reset to its default state, ready for an entry. Hint: there may be things to do other than just clearing both the input textbox and the results output label.</p>
  </li>
  <li><p>When the user clicks the button to exit, the form should close, ending the program</p>
  </li>
  </ul>
  <p>This is the code I have:</p>
  <pre><code>namespace TemperatureConversionForm
  {
      public partial class frmTemperatureConverter : Form
      {
          public frmTemperatureConverter()
          {
              InitializeComponent();
          }
  
          private void btnConvert_Click(object sender, EventArgs e)
          {
              double tempurature;
              double celsius;
              double fahrenheit;
  
              if (!double.TryParse(txtInput.Text, out tempurature) == false )
              {
                  MessageBox.Show(&quot;ERROR: Please enter a numeric temperature to convert&quot;);
                  txtInput.ResetText();
                  txtInput.Focus();
              }
  
              if (rdoCelsius.Checked == true)
              {
                  celsius = double.Parse(txtInput.Text);
                  celsius = (5.0 / 9.0 * (txtInput - 32));
                  lblConversion.Text = celsius.ToString();
              }
              else if (rdoFahrenheit.Checked == true)
              {
                  fahrenheit = double.Parse(txtInput.Text);
                  fahrenheit = (txtInput * 9.0 / 5.0 + 32);
                  lblConversion.Text = fahrenheit.ToString();
              }
          }
  
          private void btnClear_Click(object sender, EventArgs e)
          {
              txtInput.ResetText();
              lblConversion.ResetText();
  
              txtInput.Focus();
          }
  
          private void btnExit_Click(object sender, EventArgs e)
          {
              this.Close();
          }
      }
  }
  </code></pre>
  <p>I am getting 2 errors:</p>
  <blockquote>
  <p>Code     Description</p>
  <p>CS0019   Operator '-' cannot be applied to operands of type 'TextBox' and 'Int'</p>
  <p>CS0019   Operator '*' cannot be applied to operands of type 'TextBox' and 'double'</p>
  </blockquote>