コード例 #1
0
        /// <summary>
        /// Cash or Party ComboBox Enter and backSpace Key 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 (!isDoAfterGridFill)
                {
                    dgvProduct.Rows.Clear();
                }
                if (e.KeyCode == Keys.Back)
                {
                    if (cmbCashorParty.SelectionStart == 0)
                    {
                        txtDate.SelectionStart = txtDate.Text.Length;
                        txtDate.Focus();
                    }

                }
                if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
                {
                    SendKeys.Send("{F10}");
                    btnCashorPartyPopup_Click(sender, e);
                }
                if (e.Control && e.KeyCode == Keys.F)
                {
                    if (cmbCashorParty.SelectedIndex != -1)
                    {

                        frmLedgerPopupObj = new frmLedgerPopup();
                        frmLedgerPopupObj.MdiParent = formMDI.MDIObj;
                        frmLedgerPopupObj.CallFromRejectionIn(this, Convert.ToDecimal(cmbCashorParty.SelectedValue.ToString()), "CashOrParty"/*CashOrSundryDeptors*/);
                    }
                    else
                    {
                        Messages.InformationMessage("Select any cash or bank account ");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RI:59" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }