private void EntradaCantidad_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { switch (e.KeyCode) { case Keys.Left: e.Handled = true; if (this.BloquearPrecio) { EntradaArticulo.Focus(); } else { EntradaUnitario.Focus(); } break; case Keys.Right: case Keys.Return: if (EntradaCantidad.SelectionStart >= EntradaCantidad.TextRaw.Length || EntradaCantidad.SelectionLength > 0) { if (this.BloquearPrecio == false) { e.Handled = true; EntradaDescuento.Focus(); } } break; case Keys.Up: System.Windows.Forms.SendKeys.Send("+{tab}"); break; case Keys.Down: System.Windows.Forms.SendKeys.Send("{tab}"); break; case Keys.D0: case Keys.D1: case Keys.D2: case Keys.D3: case Keys.D4: case Keys.D5: case Keys.D6: case Keys.D7: case Keys.D8: case Keys.D9: case Keys.Space: e.Handled = true; this.ObtenerDatosSeguimientoSiEsNecesario(); break; default: if (KeyDown != null) { KeyDown(sender, e); } break; } }
private void EntradaNoGravado_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { switch (e.KeyCode) { case Keys.E: if (e.Control) { EntradaNoGravado.SelectionLength = 0; EntradaNoGravado.SelectionStart = EntradaNoGravado.Text.Length; e.Handled = true; } break; case Keys.Left: if (EntradaNoGravado.SelectionStart == 0) { e.Handled = true; EntradaUnitario.Focus(); } break; case Keys.Right: case Keys.Return: if (EntradaNoGravado.SelectionStart >= EntradaNoGravado.TextRaw.Length || EntradaNoGravado.SelectionLength > 0) { e.Handled = true; EntradaCantidad.Focus(); } break; case Keys.Up: System.Windows.Forms.SendKeys.Send("+{tab}"); break; case Keys.Down: System.Windows.Forms.SendKeys.Send("{tab}"); break; default: if (null != KeyDown) { KeyDown(sender, e); } break; } }
private void EntradaArticulo_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.Alt == false && e.Control == false && e.Shift == false) { switch (e.KeyCode) { case Keys.Right: case Keys.Return: e.Handled = true; if (EntradaUnitario.Visible && this.ReadOnly == false && this.TemporaryReadOnly == false) { if (this.BloquearPrecio) { EntradaCantidad.Focus(); } else { EntradaUnitario.Focus(); } } else { System.Windows.Forms.SendKeys.Send("{tab}"); } break; default: if (KeyDown != null) { KeyDown(sender, e); } this.AutoUpdate = true; break; } } if (e.Alt == false && e.Control == true && e.Shift == false) { switch (e.KeyCode) { case Keys.S: this.ObtenerDatosSeguimientoSiEsNecesario(); break; } } }