Example #1
0
 private void txtValor_TextChanged(object sender, EventArgs e)
 {
     try
     {
         FormataTextBox.TextBoxMoeda(ref txtValor);
     }
     catch (Exception)
     {
         MessageBox.Show(@"Valor digitado incorretamente!");
     }
 }
        private void txtValorRecebido_TextChanged(object sender, EventArgs e)
        {
            try
            {
                FormataTextBox.TextBoxMoeda(ref txtValorRecebido);

                lblTroco.Text = (Convert.ToDecimal(txtValorRecebido.Text) - Convert.ToDecimal(lblValorTotal.Text)).ToString("0.00");
            }
            catch (Exception)
            {
                MessageBox.Show(@"Valor Recebido digitado incorretamente!");
            }
        }
Example #3
0
        private void txtDesconto_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (radDescDinheiro.Checked)
                {
                    FormataTextBox.TextBoxMoeda(ref txtDesconto);
                }
                else if (radDescPorcentagem.Checked)
                {
                    if (txtDesconto.Text == string.Empty)
                    {
                        txtDesconto.Text = "0";
                    }
                }

                AtualizaValores();
            }
            catch (Exception)
            {
                MessageBox.Show(@"Valor Recebido digitado incorretamente!");
            }
        }