private void EntradaDescuento_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Left: if (EntradaDescuento.SelectionStart == 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 EntradaUnitario_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { switch (e.KeyCode) { case Keys.E: if (e.Control) { EntradaUnitario.SelectionLength = 0; EntradaUnitario.SelectionStart = EntradaUnitario.Text.Length; e.Handled = true; } break; case Keys.Left: if (EntradaUnitario.SelectionStart == 0) { e.Handled = true; EntradaArticulo.Focus(); } break; case Keys.Right: case Keys.Return: if (EntradaUnitario.SelectionStart >= EntradaUnitario.TextRaw.Length || EntradaUnitario.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; } } }