/// <summary> /// Enter key and backspace navigation and quick access /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashorBankAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (dgvDailySalaryVoucher.RowCount > 0) { dgvDailySalaryVoucher.Focus(); dgvDailySalaryVoucher.Rows[0].Cells["cmbStatus"].Selected = true; dgvDailySalaryVoucher.CurrentCell = dgvDailySalaryVoucher.Rows[0].Cells["cmbStatus"]; } else { txtNarration.Focus(); } } if (e.KeyCode == Keys.Back) { if (txtSalaryDate.Enabled != false) { txtSalaryDate.Focus(); txtSalaryDate.SelectionStart = 0; txtSalaryDate.SelectionLength = 0; } else { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbCashorBankAccount.SelectedIndex != -1) { frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromDailySalaryVoucher(this, Convert.ToDecimal(cmbCashorBankAccount.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account "); } } if (e.Alt && e.KeyCode == Keys.C)//To open Acc.Ledger Form { SendKeys.Send("{F10}"); btnAccountLedgerAdd_Click(sender, e); } } catch (Exception ex) { MessageBox.Show("DSV42:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }