private void BtnConvertir_Click(object sender, EventArgs e)
        {
            double gln;

            gln = Convert.ToDouble(TxtGalones.Text.Trim());

            galn.galones(gln);

            TxtGalones.Clear();
            TxtGalones.Focus();
        }
Пример #2
0
        private void BtnConvertir_Click(object sender, EventArgs e)
        {
            if (TxtGalones.Text.Trim().Length == 0)
            {
                MessageBox.Show("Ingrese Galones");
                TxtGalones.Focus();
                return;
            }
            double g, l;

            g = Convert.ToDouble(TxtGalones.Text);

            l = g * 3.785411784;

            TxtLitros.Text = l.ToString();
        }
Пример #3
0
        private void BtnCalcular_Click(object sender, EventArgs e)
        {
            if (TxtGalones.Text.Trim().Length == 0)
            {
                MessageBox.Show("Error");
                TxtGalones.Focus();
                return;
            }
            double gal, lt;

            gal = Convert.ToDouble(TxtGalones.Text);

            lt = gal * 3.785;

            TxtLitros.Text = lt.ToString();
        }