-5
如何將此從form
轉移到我的新增班級calculate
?如何在我的新類中調用此form.cs代碼計算?
form.cs
private void button1_Click(object sender, EventArgs e)
{
int a;
double b=0;
//input
a = int.Parse(textBox1.Text); //<-textbox1//
//process
b = (1.8) * (a + 32);
//output
MessageBox.Show(b.ToString(), "Fahrenheit");
textBox2.Text=b.ToString();//
}
calculate.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace calculator
{
class calculate
{
}
毫無疑問,註釋掉的代碼?又該這是? –
請正確格式化您的問題。添加解釋什麼是問題和什麼是所需的輸出。解釋你爲了解決它而研究的內容。 [如何問...](https://stackoverflow.com/help/how-to-ask) –
@GiladGreen看來,他第一次問這裏的問題 –