private void Button_Click(object sender, RoutedEventArgs e) { Retangulo r = new Retangulo(); r.SetBase(double.Parse(txtBase.Text)); r.SetAltura(double.Parse(txtAltura.Text)); txtArea.Text = r.CalcArea().ToString(); txtDiagonal.Text = r.CalcDiagonal().ToString(); }
private void CalcularClick(Object sender, RoutedEventArgs e) { Retangulo x = new Retangulo(); x.SetBase(double.Parse(txtB.Text)); x.SetAltura(double.Parse(txtAlt.Text)); txtA.Text = x.CalcArea().ToString("0"); txtD.Text = x.CalcDiagonal().ToString("0"); }
private void Button_Click(object sender, RoutedEventArgs e) { Retangulo x = new Retangulo(); x.SetAltura(double.Parse(a.Text)); x.SetBase(double.Parse(b.Text)); area.Text = x.CalcArea().ToString(); diagonal.Text = x.CalcDiagonal().ToString(); }