/// <summary> /// Form keydown for quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmPurchaseOrder_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Escape) { if (PublicVariables.isMessageClose) { Messages.CloseMessage(this); } else { this.Close(); } } if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control) { btnSave.Focus(); btnSave_Click(sender, e); } if (btnDelete.Enabled == true) { if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control) { btnDelete_Click(sender, e); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { if (dgvPurchaseOrder.CurrentCell != null) { if (dgvPurchaseOrder.CurrentCell == dgvPurchaseOrder.CurrentRow.Cells["dgvtxtProductName"] || dgvPurchaseOrder.CurrentCell == dgvPurchaseOrder.CurrentRow.Cells["dgvtxtProductCode"]) { SendKeys.Send("{F10}"); if (dgvPurchaseOrder.Columns[dgvPurchaseOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductName" || dgvPurchaseOrder.Columns[dgvPurchaseOrder.CurrentCell.ColumnIndex].Name == "dgvtxtProductCode") { frmProductCreation frmProductCreationObj = new frmProductCreation(); frmProductCreationObj.MdiParent = formMDI.MDIObj; frmProductCreationObj.CallFromPurchaseOrder(this); } } } } } catch (Exception ex) { MessageBox.Show("PO62:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }