private void button1_Click(object sender, EventArgs e) { float p = Convert.ToInt32(Convert.ToDecimal(textBox1.Text)); float t = Convert.ToInt32(Convert.ToDecimal(textBox1.Text)); float r = Convert.ToInt32(Convert.ToDecimal(textBox1.Text)); calculate c = new calculate(p, t, r); float ans = c.cal(); label1.Text = ans.ToString(); }
public Form1() { InitializeComponent(); c1 = new calculate(a, b); }