private void Txt_CanMov_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CanMov.Text.Trim() != "" && Convert.ToDecimal(Txt_CanMov.Text) > 0)
                {
                    Util.CambiarTxt(Txt_CanMov, Txt_CatMov);
                    Txt_CatMov.Text = "0";
                    Txt_CatMov.SelectAll();
                }
                else
                {
                    MessageBox.Show("El campo de cantidad debe ser mayor a 0 ó esta vaio.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    Txt_CanMov.SelectAll();
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_CanMov, Txt_CodPro);
                SwActivoM = false;
                break;
            }
        }
Ejemplo n.º 2
0
        private void Txt_CatMov_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                e.SuppressKeyPress = true;
                if (Txt_CatMov.Text.Trim() != "" && Util.FormatDecimal(Txt_CatMov.Text) > 0)
                {
                    Cmd_Guardar.PerformClick();
                }
                else
                {
                    MessageBox.Show("El campo de cantidad debe ser mayor a 0 ó esta vaio.", "Atención", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    Txt_CatMov.SelectAll();
                }
                break;

            case Keys.Escape:
                e.SuppressKeyPress = true;
                Util.CambiarTxt(Txt_CatMov, Txt_ObsVac);
                break;
            }
        }