Example #1
0
 /// <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)
     {
         MessageBox.Show("MSR18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <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)
            {
                MessageBox.Show("MSR18:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }