From what i understand from your question, you want to create a class to calculate temperature based on user input in TextBox1 and show it in TextBox2. If that is so, you can do this:
static class Calculate
{
public static double Temperature(int input)
{
double result = (1.8) * (input + 32);
return result;
}
}
Now you can call it using
Calculate.Temperature(*pass value here*);
For Eg:
int a = int.Parse(textBox1.Text);
double result = Calculate.Temperature(a);
MessageBox.Show(result.ToString(), "Fahrenheit");
textBox2.Text=result.ToString();//
1
solved how do i transfer this form.cs code in my new class calculate?