예제 #1
0
        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());
        }
예제 #2
0
        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());
            }
        }