Exemplo n.º 1
0
        private void frmPardakhtMain_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                case Keys.F1:
                    mnuAddNaqd.PerformClick();
                    break;

                case Keys.F3:
                    mnuAddCheckSh.PerformClick();
                    break;

                case Keys.F2:
                    mnuAddHavale.PerformClick();
                    break;

                case Keys.F4:
                    mnuAddCheckM.PerformClick();
                    break;

                case Keys.F7:
                    mnuEdit.PerformClick();
                    break;

                case Keys.F5:
                    btnFinish.PerformClick();
                    break;

                case Keys.F9:
                    var frm = new frmShowDesc();
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        txtDesc.Text = frm.Description;
                    }
                    break;

                case Keys.Delete:
                    mnuDelete.PerformClick();
                    break;

                case Keys.Escape:
                    Close();
                    break;
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Exemplo n.º 2
0
        private void frmSanadMain_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                case Keys.Enter:
                    if (!btnFinish.Focused && !btnCancel.Focused)
                    {
                        SendKeys.Send("{Tab}");
                    }
                    break;

                case Keys.F5:
                    btnFinish.PerformClick();
                    break;

                case Keys.F1:
                    btnSaveArticle.PerformClick();
                    break;

                case Keys.Escape:
                    btnCancel.PerformClick();
                    break;

                case Keys.F7:
                    mnuEdit.PerformClick();
                    break;

                case Keys.F9:
                    var frm = new frmShowDesc();
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        txtDesc.Text = frm.Description;
                    }
                    break;

                case Keys.Delete:
                    mnuDelete.PerformClick();
                    break;
                }
            }
            catch (Exception exception)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(exception);
            }
        }