/// <summary> /// Enterkey and backspace navigation of cmbPurchaseAccount /// Alt+c for purchase account creation /// Ctrl+f for popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbPurchaseAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { cmbVoucherType.Focus(); } else if (e.KeyCode == Keys.Back) { if (cmbPurchaseAccount.Text == string.Empty || cmbPurchaseAccount.SelectionStart == 0) { cmbCurrency.Focus(); } } else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnPurchaseacntAdd_Click(sender, e); } else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { cmbCashOrParty.DropDownStyle = (cmbCashOrParty.Focused) ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList; if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPurchaseReturn(this, Convert.ToDecimal(cmbPurchaseAccount.SelectedValue.ToString()), "PurchaseAccount"); } else { Messages.InformationMessage("Select any purchase account"); } } } catch (Exception ex) { MessageBox.Show("PR:100" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Enterkey and backspace navigation of cmbCashOrparty /// Alt+c for cashorparty creation /// Ctrl+f for popup /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (cmbCurrency.Enabled == true) { cmbCurrency.Focus(); } else { cmbPurchaseAccount.Focus(); } } else if (e.KeyCode == Keys.Back) { txtDate.Focus(); txtDate.SelectionStart = 0; txtDate.SelectionLength = 0; } else if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnCashorPartyAdd_Click(sender, e); } else if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { cmbCashOrParty.DropDownStyle = (cmbCashOrParty.Focused) ? ComboBoxStyle.DropDown : ComboBoxStyle.DropDownList; if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromPurchaseReturn(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryCreditors"); } else { Messages.InformationMessage("Select any cash or party"); } } } catch (Exception ex) { MessageBox.Show("PR:98" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }