Ejemplo n.º 1
0
        /// <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)
                {
                    cmbVoucherType.Focus();
                }
                if (e.KeyCode == Keys.Back)
                {
                    if (cmbCashOrParty.Text == string.Empty || cmbCashOrParty.SelectionStart == 0)
                    {
                        txtDate.Focus();
                        txtDate.SelectionStart = 0;
                        txtDate.SelectionLength = 0;
                    }
                }

                if (e.Alt && e.KeyCode == Keys.C)
                {
                    SendKeys.Send("{F10}");
                    btnLedgerAdd_Click(sender, e);
                }
                if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)
                {
                    if (cmbCashOrParty.Focus())
                    {
                        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.CallFromRejectionOut(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryCreditors");
                        }
                        else
                        {
                            Messages.InformationMessage("select any ledger");
                        }

                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RO68:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Form keydown for quickaccess
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmRejectionOut_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             if (PublicVariables.isMessageClose)
             {
                 Messages.CloseMessage(this);
             }
             else
             {
                 this.Close();
             }
         }
         //----------------------------------------CTRL+S--------------------------------------------//
         if (e.Control && e.KeyCode == Keys.S)//Save or Edit
         {
             btnSave.PerformClick();
         }
         //----------------------------------------CTRL+D--------------------------------------------//
         if (e.Control && e.KeyCode == Keys.D)//Delete
         {
             btnDelete.PerformClick();
         }
         //-------------------------------------------ALT+C-----------------------------------------//
         if (e.Alt && e.KeyCode == Keys.C)
         {
             SendKeys.Send("{F10}");
             btnLedgerAdd_Click(sender, e);
         }
         //-------------------------------------------CTRL+F-----------------------------------------//
         if (e.KeyCode == Keys.F && Control.ModifierKeys == Keys.Control)
         {
             if (cmbCashOrParty.Focus())
             {
                 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.CallFromRejectionOut(this, Convert.ToDecimal(cmbCashOrParty.SelectedValue.ToString()), "CashOrSundryCreditors");
                 }
                 else
                 {
                     Messages.InformationMessage("select any ledger");
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RO65:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }