private void button1_Click(object sender, EventArgs e) { rec a = new rec(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text)); ar = a.getarea(); label4.Text = "Area is :" + ar; }
private void button2_Click(object sender, EventArgs e) { rec a = new rec(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text)); ar = a.getarea(); int cost = a.getcost(ar); label3.Text += "\n Cost is: " + cost; }