private void btn_dolar_Click(object sender, EventArgs e) { Dolares dol = new Dolares(double.Parse(txtDolar.Text)); txtDolarDolar.Text = string.Format("{0}", dol.GetCantidad()); txtDolarEuro.Text = string.Format("{0}", ((Euros)dol).GetCotizacion()); txtDolarPesos.Text = string.Format("{0}", ((Pesos)dol).GetCotizacion()); }
private void button2_Click(object sender, EventArgs e) { double d; if (double.TryParse(textBox2.Text, out d)) { Dolares p = new Dolares(d); textBox12.Text = string.Format("{0,10:#,###.00}", p.GetCantidad()); textBox5.Text = string.Format("{0,10:#,###.00}", ((Pesos)p).GetCantidad()); textBox9.Text = string.Format("{0,10:#,###.00}", ((Euros)p).GetCantidad()); } }