/// <summary> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbSalesAccount_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtCustomer.Focus(); } if (e.KeyCode == Keys.Back) { if (cmbPricingLevel.Enabled == true) { cmbPricingLevel.Focus(); } else { cmbSalesModeOrderNo.Focus(); } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewSalesAccount_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up { if (cmbSalesAccount.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromSalesInvoice(this, Convert.ToDecimal(cmbSalesAccount.SelectedValue.ToString()), "SalesAccount"); } else { Messages.InformationMessage("Select any Sales Account"); } } } catch (Exception ex) { MessageBox.Show("SI: 134" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// For enter key and backspace navigation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void cmbCashOrParty_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { txtCreditPeriod.Focus(); } if (e.KeyCode == Keys.Back) { if (txtDate.Enabled == true) { txtDate.Focus(); txtDate.SelectionLength = 0; txtDate.SelectionStart = 0; } } if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt) { SendKeys.Send("{F10}"); btnNewLedger_Click(sender, e); } if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) { if (cmbCashOrParty.Focused) { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDown; } else { cmbCashOrParty.DropDownStyle = ComboBoxStyle.DropDownList; } if (cmbCashOrParty.SelectedIndex != -1) { frmLedgerPopup frmLedgerPopupObj = new frmLedgerPopup(); frmLedgerPopupObj.MdiParent = formMDI.MDIObj; frmLedgerPopupObj.CallFromSalesInvoice(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryDeptors"); } else { Messages.InformationMessage("Select any cash or party"); } } } catch (Exception ex) { MessageBox.Show("SI: 133" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }