Windows programme to convert temperature in C#.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace tempreture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double val1;
double val2;
private void textBox1_TextChanged(object sender, EventArgs e)
{
double val1;
val1 = double.Parse(textBox1.Text);
}
private double farhen()
{
double farenhiet;
farenhiet = (val1 * 9 / 5) + 32;
return farenhiet;
}

private void button1_Click(object sender, EventArgs e)
{
textBox2 = farhen(val2).ToString();
}

private void textBox3_TextChanged(object sender, EventArgs e)
{
double val2;
val2 = double.Parse(textBox1.Text);
}

private void button2_Click(object sender, EventArgs e)
{
textBox2 = farhen(val2).ToString();
}
private double cels()
{
double cels;
cels= (val2-32) * 5/ 9 ;
return cels;
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}