コード例 #1
0
        private void txtNombreProducto_KeyDown(object sender, KeyEventArgs e)
        {
            NegocioArticulo objart = new NegocioArticulo();

            if (e.KeyCode == Keys.Down && Dtproducto.Visible == true)
            {
                //si se preciona la tecla hacia abajo se pasa el foco a la grilla
                Dtproducto.Focus();
            }

            if (e.KeyCode == Keys.Enter && IsNumeric(txtNombreProducto.Text) == true)
            {
                txtNombreProducto.Text = txtNombreProducto.TextLength == 12 ? "0" + txtNombreProducto.Text : txtNombreProducto.Text;
                if (txtNombreProducto.TextLength >= 13 && IsNumeric(txtNombreProducto.Text) == true)
                {
                    objart.extraerdatos(0, "porbarra", txtNombreProducto.Text);
                    codigoproducto = objart.IdArticulo.ToString();
                    extraerproducto(objart.IdArticulo);
                }
                else
                {
                    extraerproducto(Convert.ToInt32(txtNombreProducto.Text));
                }


                txtcantidad.Focus();
            }
        }
コード例 #2
0
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Down && Dtproducto.Visible == true)
     {
         //si se preciona la tecla hacia abajo se pasa el foco a la grilla
         Dtproducto.Focus();
     }
 }