private void txtEmpresa_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { FrmBuscar Fe = new FrmBuscar(txtEmpresa, txtDes_emp, "Empresa"); Fe.Show(); } }
private void txtUsuario_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { FrmBuscar Fe = new FrmBuscar(txtUsuario, txtDes_Usuario, "Usuario"); Fe.Show(); } }
private void txtCo_naviera_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { FrmBuscar Fe = new FrmBuscar(txtCo_naviera, txtNavi_des, "Naviera"); Fe.Show(); } }
private void txtProv_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { FrmBuscar Fe = new FrmBuscar(txtProv, txtProv_des, "Proveedor", txtEmpresa.Text.Trim()); Fe.Text = "Proveedores"; Fe.Show(); } }
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { if (grdDatos.RowCount > 0 && grdDatos.RowCount > -1) { int icolumn = grdDatos.CurrentCell.ColumnIndex; int irow = grdDatos.CurrentCell.RowIndex; if (keyData == Keys.Enter) { if (icolumn == grdDatos.Columns.Count - 1 || icolumn == 4) { if (MessageBox.Show("Desea agregar un nuevo renglon?", "Profit Expansion", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) { NuevoRenglon(); grdDatos.CurrentCell = grdDatos[1, irow + 1]; } else { grdDatos.CurrentCell = grdDatos[1, irow]; } } else { grdDatos.CurrentCell = grdDatos[icolumn == 1 ? 3 : icolumn + 1, irow]; } return(true); } if (keyData == Keys.F2 && txtEmpresa.Focused == false && txtProv.Focused == false) { if (icolumn == 1) { FrmBuscar Fb = new FrmBuscar(Tc, Td, "Articulo", txtEmpresa.Text.Trim()); Fb.Text = "Articulos"; Fb.Show(); return(true); } else { return(base.ProcessCmdKey(ref msg, keyData)); } } else { return(base.ProcessCmdKey(ref msg, keyData)); } } else { return(base.ProcessCmdKey(ref msg, keyData)); } }
private void txtCo_art_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { FrmBuscar Fe = new FrmBuscar(txtCo_art, txtArt_des, "Articulo"); Fe.Show(); } if (e.KeyCode == Keys.Enter) { txtCo_art_Leave(sender, e); btnBuscar_Click(sender, e); } }
private void txtCo_shipper_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F2) { if (txtCo_consig.Text.Trim().Length == 0) { MessageBox.Show("Debe elegir una empresa.", "Profit Expansion", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtCo_consig.Focus(); } else { FrmBuscar Fe = new FrmBuscar(txtCo_shipper, txtShipper_des, "Shipper", txtCo_consig.Text.Trim()); Fe.Show(); } } }