title: How do I get a Windows Form App to work with a class?
body: <p>I'm a beginner learning Windows Forms Applications in C# and I want to write a program that will prompt the user to enter the name of a place and to enter 2 digit temperature (F) between ranges 20 and 100. When the user presses the "OK" button on the form I want to have a messagebox displaying the name of the place they entered, and the temperature (F) they entered plus its Celsius conversion and an error message in case any of the fields is left blank or if the temp falls beyond the range.</p>
  
  <p>I would like to have a class to handle the conversion and the logic.</p>
  
  <p>I'm still learning guys and I've spent all day on this already only getting a few pieces of code working but I'm afraid I'm not understanding what I'm doing. I'm ok with the form design, what I have an issue with, is the c# code and using classes. I'd really appreciate if someone could show me code or good hints for what I want to do.</p>
  
  <p>For your sake I'm not including my code because it may confuse you then we'll spend hours talking about "why did I do something" but if you really want to see it let me know.</p>
  
  <p>Being a beginner I'd much appreciate beginner-like answers.
  Thank you guys !</p>
  
  <pre><code>// Form1.cs
  
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  
  namespace airports
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void textBox1_TextChanged(object sender, EventArgs e)
          {
  
          }
  
          private void label2_Click(object sender, EventArgs e)
          {
  
          }
  
          private void label3_Click(object sender, EventArgs e)
          {
  
          }
  
          private void btn_quit_Click(object sender, EventArgs e)
          {
              base.Close();
              return;
          }
  
          public void btn_record_Click(object sender, EventArgs e)
          {
              string place;
              place = Console.ReadLine();
              Calculations name = new Calculations();
              //double temp = Convert.ToDouble(txtTemperature.Text);
              //Calculation ctemp = new Calculation();
  
  
          MessageBox.Show(name.GetPlaceName("Calculations: " + txtPlaceName.Text));
          //MessageBox.Show(string.Format("Temperature: {0}", (ctemp.GetTemp(celsiusTemp.text))));
  
  
  }
  
  
  //Class
  
  
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  
  namespace Calculations
  {
      class Calculations
      {
  
  
          string placeName;
          double celsiusTemp;
  
          public string GetPlaceName(string place)        
  {
  
                  return placeName = place;            
          }
  
      public double GetTemp(double temp)
          {
              return celsiusTemp = (temp + 10); 
          }
  
      }
  }
  </code></pre>