示例#1
0
 /// <summary>
 /// For Enter key and backspace navigation
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmbBank_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             txtcheckNo.Focus();
             txtcheckNo.SelectionStart = 0;
             txtcheckNo.SelectionLength = 0;
         }
         else if (e.KeyCode == Keys.Back)
         {
             if (cmbBank.Text == string.Empty || cmbBank.SelectionStart == 0)
             {
                 txtAmount.Focus();
                 txtAmount.SelectionStart = 0;
                 txtAmount.SelectionLength = 0;
             }
         }
         else if (e.Alt && e.KeyCode == Keys.C)
         {
             SendKeys.Send("{F10}");
             btnNewAccountLedger2_Click(sender, e);
         }
         if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up
         {
             if (cmbBank.SelectedIndex != -1)
             {
                 frmLedgerPopupObj = new frmLedgerPopup();
                 frmLedgerPopupObj.MdiParent = formMDI.MDIObj;
                 frmLedgerPopupObj.CallFromPdcpayableVoucher(this, Convert.ToDecimal(cmbBank.SelectedValue.ToString()), "Bank");
                 this.Enabled = false;
             }
             else
             {
                 Messages.InformationMessage("Select any Bank account");
                 cmbBank.Text = string.Empty;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP56:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }