Exemplo n.º 1
0
 /// <summary>
 /// key navigation for frmPartyBalance form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmPartyBalance_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (dgvPartyBalance.CurrentRow != null)
         {
             if (dgvPartyBalance.CurrentCell.ColumnIndex == dgvPartyBalance.Columns["dgvcmbVoucherType"].Index)
             {
                 if (dgvPartyBalance.CurrentRow.Cells["dgvcmbVoucherType"].Value != null && dgvPartyBalance.CurrentRow.Cells["dgvcmbVoucherType"].Value.ToString() != string.Empty)
                 {
                     if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control) //Pop Up
                     {
                         frmAgainstBillDetails frmAgainstBillDetailsObj = new frmAgainstBillDetails();
                         frmAgainstBillDetailsObj.MdiParent = formMDI.MDIObj;
                         frmAgainstBillDetailsObj.CallFromPartyBalance(this, decLedgerId, strDebitOrCredit);
                     }
                 }
             }
         }
         if (e.KeyCode == Keys.Escape)
         {
             if (PublicVariables.isMessageClose)
             {
                 IsSaveOrEsc = true;
                 Messages.CloseMessage(this);
                 IsSaveOrEsc = false;
             }
             else
             {
                 IsSaveOrEsc = true;
                 Messages.CloseMessage(this);
                 IsSaveOrEsc = false;
             }
         }
         if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
         {
             btnSave.Focus();
             dgvPartyBalance.Focus();
             Save();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PB:29" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }