using System;
using System.Drawing;
using System.Windows.Forms;
namespace MyWindowsConvert
{
public class Form1 : Form
{
private TextBox textBox1;
private Button button1;
private Label label1;
public Form1()
{
textBox1 = new TextBox();
textBox1.Location = new Point(64, 32);
textBox1.Size = new Size(120, 20);
Controls.Add(textBox1);
button1 = new Button();
button1.Location = new Point(64, 64);
button1.Size = new Size(120, 20);
button1.Text = "Get Fahrenheit";
button1.Click += new EventHandler(button1_Click);
Controls.Add(button1);
label1 = new Label();
label1.Location = new Point(64, 104);
label1.Size = new Size(120, 20);
Controls.Add(label1);
Text = "MyWindowsConvert";
}
private void button1_Click(object sender, EventArgs e)
{
double tCentigrade = double.Parse(textBox1.Text);
double tFahrenheit = 32 + tCentigrade*9/5;
label1.Text = tFahrenheit.ToString();
}
public static void Main()
{
Form1 tForm1 = new Form1();
Application.Run(tForm1);
}
}
}