/// <summary> /// Enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashBankAC_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbVoucherTypeName.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbCashBankAC.Text == string.Empty || cmbCashBankAC.SelectionStart == 0) { txtVoucherNo.SelectionStart = 0; txtVoucherNo.SelectionLength = 0; txtVoucherNo.Focus(); } } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbCashBankAC.SelectedIndex != -1) { if (cmbCashBankAC.Focused) { cmbCashBankAC.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashBankAC.DropDownStyle = ComboBoxStyle.DropDownList; } frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromMonthlySalaryRegister(this, Convert.ToDecimal(cmbCashBankAC.SelectedValue.ToString()), "CashOrBank"); } else { Messages.InformationMessage("Select any cash or bank account"); cmbCashBankAC.Text = string.Empty; } } } catch (Exception ex) { formMDI.infoError.ErrorString = "MSR18:" + ex.Message; } }
/// <summary> /// Function to call frmLedgerPopup form to select and view ledgers /// </summary> /// <param name="frmLedgerPopup"></param> /// <param name="decId"></param> public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) //PopUp { try { base.Show(); this.frmLedgerPopupObj = frmLedgerPopup; TransactionsGeneralFill obj = new TransactionsGeneralFill(); obj.CashOrBankComboFill(cmbCashBankAC, false); cmbCashBankAC.SelectedValue = decId; cmbCashBankAC.Focus(); frmLedgerPopupObj.Close(); frmLedgerPopupObj = null; } catch (Exception ex) { formMDI.infoError.ErrorString = "MSR4:" + ex.Message; } }