Inheritance: System.EventArgs
Exemple #1
2
        private void JokasoDaichoList_KeyDown(object sender, KeyEventArgs e)
        {
            TraceLog.StartWrite(MethodInfo.GetCurrentMethod());
            Cursor preCursor = Cursor.Current;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                if (e.KeyCode == Keys.Enter)
                {
                    bool forward = e.Modifiers != Keys.Shift;
                    this.SelectNextControl(this.ActiveControl, forward, true, true, true);
                    e.Handled = true;
                }
            }
            catch (Exception ex)
            {
                TraceLog.ErrorWrite(MethodInfo.GetCurrentMethod(), ex.ToString());
                MessageForm.Show(MessageForm.DispModeType.Error, MessageResouce.MSGID_E00001, ex.Message);
            }
            finally
            {
                Cursor.Current = preCursor;
                TraceLog.EndWrite(MethodInfo.GetCurrentMethod());
            }
        }
Exemple #2
1
 private void checkedListBox1_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         removeButton_Click(null, null);
     }
 }
        /// <summary>
        /// Handles key-down events</summary>
        /// <param name="sender">Control that raised original event</param>
        /// <param name="e">Event args</param>
        /// <returns>true, if controller handled the event</returns>
        public override bool KeyDown(object sender, KeyEventArgs e)
        {
            m_keyMap[e.KeyValue] = true;

            ControlScheme controlSchm = InputScheme.ActiveControlScheme;
            // W A S D for forward, strafe left, backward, strafe right, is the default
            Vec3F dir = new Vec3F();
            if (m_keyMap[(int)controlSchm.Left1] ||
                m_keyMap[(int)controlSchm.Left2])
                dir = dir - Camera.Right;
            if (m_keyMap[(int)controlSchm.Right1] ||
                m_keyMap[(int)controlSchm.Right2])
                dir = dir + Camera.Right;
            if (m_keyMap[(int)controlSchm.Forward1] ||
                m_keyMap[(int)controlSchm.Forward2])
                dir = dir + Camera.LookAt;
            if (m_keyMap[(int)controlSchm.Back1] ||
                m_keyMap[(int)controlSchm.Back2])
                dir = dir - Camera.LookAt;

            bool handled = controlSchm.IsControllingCamera(Control.ModifierKeys, e);
            

            if (handled)
            {
                dir.Normalize();
                Camera.Set(Camera.Eye + dir * m_scale);
            }

            return handled;
        }
Exemple #4
1
 //Método KeyDown
 private void txtsenha_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyValue == 13) //13 é ENTER (ASCII)
     {
         btnLogin_Click(sender, e);
     }
 }
 private void txtBankCode_KeyDown(object sender, KeyEventArgs e)
 {
     frmSelectBank frm = new frmSelectBank();
     // Add an event handler to update this form
     frm.SelectBankUpdate +=new frmSelectBank.SelectBankHandler(frm_SelectBankUpdate);
     frm.Show();
 }
Exemple #6
1
 private void button4_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData==Keys.Left)
     {
         wplayer.controls.fastForward();
     }
 }
 private void FormViewerMARKETING_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         Close();
     }
 }
Exemple #8
1
 private void button5_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData==Keys.Right)
     {
         wplayer.controls.fastReverse();
     }
 }
 void txtEditor_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Tab)
     {
         txtEditor_Leave(sender, e);
     }
 }
Exemple #10
1
 public override void DownKey(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter && !btnSave.Focused)
         SendKeys.Send("{Tab}");
     else if (e.KeyCode == Keys.F9)
         btnSave_Click(sender, e);
 }
Exemple #11
1
 private void ItemReturnFrm_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode==Keys.F4)
     {
         KeyF4();
     }
 }
 private void textBoxQuantity_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         this.textBoxBarCode.Focus();
     }
 }
 private void FilterTemplateName_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode == Keys.Escape) {
         this.DialogResult = DialogResult.Cancel;
         this.Close();
     }
 }
 private void TemplateName_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode == Keys.Enter) {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
 private void PrinterChooseForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
         btnOk_Click(null, null);
     else if (e.KeyCode == Keys.Escape)
         this.DialogResult = DialogResult.Cancel;
 }
 private void dgSalesOrder_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         e.SuppressKeyPress = true;
         //LL Phalaborwa if
         if (dgSalesOrder.Rows.Count > 0)
         {
             sResult = dgSalesOrder.SelectedRows[0].Cells[0].Value.ToString();
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     }
     else
     {
         //if (e.KeyValue > 40)
         //{
         //    e.SuppressKeyPress = true;
         //    txtSalesNumber.Text += char.ConvertFromUtf32(e.KeyValue).ToString();
         //    txtSalesNumber.Focus();
         //    txtSalesNumber.SelectionStart = txtSalesNumber.Text.Length;
         //    txtSalesNumber.SelectionLength = 0;
         //}
     }
 }
 protected override void OnKeyDown(KeyEventArgs e)
 {
     base.OnKeyDown(e);
     switch (e.KeyCode)
     {
         case Keys.D:
             if (form == null)
             {
                 form = new Form();
                 form.Text = "Undocked Control";
                 form.Width = Width;
                 form.Height = Height;
                 form.FormBorderStyle = FormBorderStyle.SizableToolWindow;
                 this.Controls.Remove(control);
                 form.Controls.Add(control);
                 form.FormClosed += delegate (object sender,FormClosedEventArgs ee)
                 {
                     form.Controls.Remove(control);
                     this.Controls.Add(control);
                     form = null;
                 };
                 form.Show();
             }
             else
             {
                 form.Close();
             }
             break;
     }
 }
Exemple #18
1
 private void BaseForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Hide();
     }
 }
Exemple #19
1
        private void txtPass_KeyDown(object sender, KeyEventArgs e)
        {

            if (e.KeyCode == Keys.Enter)

                try
                {
                    this.err.Clear();
                    var isValid = userRepo.Login(this.txtUser.Text, this.txtPass.Text, AppContext.CurrentClinic.Id);
                    if (isValid)
                    {
                        AppContext.Authenticated = true;
                        AppContext.LoggedInUser = userRepo.Get(this.txtUser.Text);
                        this.Close();
                    }
                    else
                    {
                        this.err.SetError(txtPass, "Tài khoản không hợp lệ");
                        this.err.SetError(txtUser, "Tài khoản không hợp lệ");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

        } 
 private void archiveList_KeyDown(object sender, KeyEventArgs e)
 {
     if ((e.KeyCode == Keys.Delete) && archiveList.SelectedItems.Count > 0)
     {
         DeleteThought();
     }
 }
Exemple #21
1
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
     {
         this.Close();
     }
 }
Exemple #22
1
 private void Add_Ecip_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }
Exemple #23
1
 private void txtTitle_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         btnOkay_Click(null, null);
     }
 }
Exemple #24
1
 private void txtPassword_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         btnLogin_Click(null, null);
     }
 }
 /// <summary>
 /// Return true to handle the keypress, return false to let the text area handle the keypress
 /// </summary>
 void TextAreaKeyEventHandler(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.OemOpenBrackets && e.Shift)
     {
         ICompletionDataProvider snippetDataProvider = new SnippetDataProvider(mainForm.AutoCompleteImageList);
         codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
             mainForm,					// The parent window for the completion window
             editor, 					// The text editor to show the window for
             "",		// Filename - will be passed back to the provider
             snippetDataProvider,		// Provider to get the list of possible completions
             Convert.ToChar(e.KeyCode)	    					// Key pressed - will be passed to the provider
         );
     }
     else
     {
         ICompletionDataProvider completionDataProvider = new CodeCompletionProvider(mainForm.AutoCompleteImageList);
         codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(
             mainForm,					// The parent window for the completion window
             editor, 					// The text editor to show the window for
             "",		// Filename - will be passed back to the provider
             completionDataProvider,		// Provider to get the list of possible completions
             Convert.ToChar(e.KeyCode)	    					// Key pressed - will be passed to the provider
         );
     }
     if (codeCompletionWindow != null)
     {
         // ShowCompletionWindow can return null when the provider returns an empty list
         codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow);
     }
     return;
 }
Exemple #26
1
 private void ContrasenatextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         IniciarSesion();
     }
 }
 private void MaskedTextBoxKeyDown_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendKeys.Send("{TAB}");
     }
 }
 private void FormKeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }
 private void lvProgramm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         RemoveSelected();
     }
 }
 private void numJug_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         this.Iniciar();
     }
 }
Exemple #31
0
 private void NameForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     this.C_textName_KeyDown(sender, e);
 }
Exemple #32
0
 //按键操作
 private void MainForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (block != null && this.paused == false && !this.failed && block2 != null)
     {
         if (e.KeyCode == this.keys[0])
         {
             if (block.Move(0))
             {
                 block.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[1])
         {
             if (block.Move(1))
             {
                 block.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[2])
         {
             if (!block.Move(2))
             {
                 this.FixAndCreate();
             }
             else
             {
                 block.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[3])
         {
             if (block.Rotate())
             {
                 block.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[4])
         {
             block.Drop();
             block.EraseLast();
             this.FixAndCreate();
         }
         else if (e.KeyCode == this.keys[5])
         {
             if (block2.Move(0))
             {
                 block2.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[6])
         {
             if (block2.Move(1))
             {
                 block2.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[7])
         {
             if (!block2.Move(2))
             {
                 this.FixAndCreate2();
             }
             else
             {
                 block2.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[8])
         {
             if (block2.Rotate())
             {
                 block2.EraseLast();
             }
         }
         else if (e.KeyCode == this.keys[9])
         {
             block2.Drop();
             block2.EraseLast();
             this.FixAndCreate2();
         }
     }
 }
Exemple #33
0
 public bool OnKeyUp(System.Windows.Forms.KeyEventArgs e)
 {
     return(false);
 }
Exemple #34
0
 //按键
 private void FormMain_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Left)
     {
         if (Game.CanOp)
         {
             AllShapes.ToLeft(Globals.IndexOfCurrentShape);
             Sound.PlaySound(Application.StartupPath + @"\Sounds\Left.wav", IntPtr.Zero, 1);
         }
     }
     else if (e.KeyCode == Keys.Right)
     {
         if (Game.CanOp)
         {
             AllShapes.ToRight(Globals.IndexOfCurrentShape);
             Sound.PlaySound(Application.StartupPath + @"\Sounds\Right.wav", IntPtr.Zero, 1);
         }
     }
     else if (e.KeyCode == Keys.Down)
     {
         if (Game.CanOp)
         {
             AllShapes.timer.Stop();
             AllShapes.ToDown(Globals.IndexOfCurrentShape);
             AllShapes.timer.Start();
         }
     }
     else if (e.KeyCode == Keys.Up)
     {
         if (Game.CanOp)
         {
             AllShapes.Eddy(Globals.IndexOfCurrentShape);
             Sound.PlaySound(Application.StartupPath + @"\Sounds\Up.wav", IntPtr.Zero, 1);
         }
     }
     else if (e.KeyCode == Keys.Q)
     {
         Game.StartNewGame();
     }
     else if (e.KeyCode == Keys.P)
     {
         if (Game.State == GameStates.Playing)
         {
             Game.Pause();
         }
         else if (Game.State == GameStates.Paused)
         {
             Game.Resume();
         }
     }
     else if (e.KeyCode == Keys.O)           //设置
     {
         Game.Pause();
         FormSet fs = new FormSet();
         fs.ShowDialog();
     }
     else if (e.KeyCode == Keys.S)           //save
     {
         Game.Pause();
         FormSave fs = new FormSave();
         fs.ShowDialog();
     }
     else if (e.KeyCode == Keys.L)           //Load
     {
         Game.Pause();
         FormLoad fL = new FormLoad();
         fL.ShowDialog();
     }
     else if (e.KeyCode == Keys.D1)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(1);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D2)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(2);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D3)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(3);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D4)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(4);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D5)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(5);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D6)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(6);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D7)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(7);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D8)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(8);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
     else if (e.KeyCode == Keys.D9)
     {
         if (Game.State == GameStates.Stoped)
         {
             Game.ChangeLevel(9);
         }
         else
         {
             this.labelTempInfo.Text = "游戏过程中不可设置速度级别";
         }
     }
 }
Exemple #35
0
 private void m_pTextBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     this.OnKeyDown(e);
 }
Exemple #36
0
 private void FormView_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     PictureView.CancelShift();
 }
Exemple #37
0
 private void txt_SpeedSearch_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     SpeedSearch();
 }
Exemple #38
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.P)
            {
                PauseUnpause();
                return;
            }

            if (_paused)
            {
                return;
            }

            switch (e.KeyCode)
            {
            case Keys.Down:
                foreach (var actor in Level.Actors)
                {
                    actor.Drop();
                }
                break;

            case Keys.Up:
                foreach (var actor in Level.Actors)
                {
                    actor.Action();
                }
                break;

            case Keys.R:
                RestartLevel();
                break;

            case Keys.J:
                if (e.Control && e.Shift)
                {
                    NextLevel();
                }
                break;

            case Keys.D:
                if (e.Control && e.Shift)
                {
                    _debug = !_debug;
                    RerenderStaticGraphics();
                }
                break;

            case Keys.OemPeriod:
                if (_debug && e.Control && e.Shift)
                {
                    foreach (var actor in Level.Actors)
                    {
                        actor.Location += new Vector2(0.05, 0);
                    }
                }
                break;

            case Keys.Oemcomma:
                if (_debug && e.Control && e.Shift)
                {
                    foreach (var actor in Level.Actors)
                    {
                        actor.Location += new Vector2(-0.05, 0);
                    }
                }
                break;
            }
        }
Exemple #39
0
        public void SendKeyUp(System.Windows.Forms.KeyEventArgs e)
        {
            uint lparam = 0x80000000;

            PostMessage(this.handle, WM_KEYUP, e.KeyValue, (int)lparam);
        }
Exemple #40
0
 /// <summary>
 /// this method is called from <see cref="WinControl"/>, if the <see cref="EventServer"/> returns true.
 /// </summary>
 /// <param name="e">KeyEventArgs</param>
 virtual protected void onKeyUp(System.Windows.Forms.KeyEventArgs e)
 {
 }
Exemple #41
0
 private void targetControl_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     this.keyUp(this, e);
 }
Exemple #42
0
 public void SendKeyDown(System.Windows.Forms.KeyEventArgs e)
 {
     PostMessage(this.handle, WM_KEYDOWN, e.KeyValue, 0);
     //PostMessage(this.handle, WM_CHAR, e.KeyValue, (int)lparam);
 }
        protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
        {
            if (!readOnly)
            {
                e.Handled = true;
                switch (e.KeyCode)
                {
                case Keys.Left:
                case Keys.Right:
                case Keys.Up:
                case Keys.Down:
                case Keys.Home:
                case Keys.End:
                    e.SuppressKeyPress = true;
                    if (e.Shift && selectable)
                    {
                        if (selectionStart == null)
                        {
                            selectionStart = new Caret(caret);
                        }
                    }
                    else if (selectionStart != null)
                    {
                        selectionStart = null;
                        UpdateSelection();
                    }
                    if (e.KeyCode == Keys.Left)
                    {
                        if (e.Control)
                        {
                            caret.MoveToBeginningOfWord();
                        }
                        else
                        {
                            caret--;
                        }
                    }
                    if (e.KeyCode == Keys.Right)
                    {
                        if (e.Control)
                        {
                            caret.MoveToEndOfWord();
                        }
                        else
                        {
                            caret++;
                        }
                    }
                    if (e.KeyCode == Keys.Up)
                    {
                        caret.Up();
                    }
                    if (e.KeyCode == Keys.Down)
                    {
                        caret.Down();
                    }
                    if (e.KeyCode == Keys.Home)
                    {
                        caret.Set(0, caret.Row);
                    }
                    if (e.KeyCode == Keys.End)
                    {
                        caret.Set(document.Lines[caret.Row].Length - 1, caret.Row);
                    }
                    OnCaretChanged();
                    break;

                case Keys.Back:
                case Keys.Delete:
                    if (selectionStart != null)
                    {
                        int selpos = selectionStart.Position;
                        DeleteSelection();
                        caret.Position = Math.Min(caret.Position, selpos);
                        OnTextChanged();
                    }
                    else
                    {
                        if (caret > 0 && e.KeyCode == Keys.Back)
                        {
                            caret--;
                            document.Remove(caret, 1);
                            OnTextChanged();
                        }
                        else if (caret <= document.Length - 1 && e.KeyCode == Keys.Delete)
                        {
                            document.Remove(caret, 1);
                            OnTextChanged();
                        }
                    }
                    e.SuppressKeyPress = true;
                    break;

                case Keys.X:
                    if (e.Control)
                    {
                        if (selectionStart != null)
                        {
                            string s = SelectedText();
                            if (s.Length > 0)
                            {
                                Clipboard.SetText(s);
                            }
                            DeleteSelection();
                            OnTextChanged();
                        }
                        e.SuppressKeyPress = true;
                    }
                    break;

                case Keys.C:
                    if (e.Control)
                    {
                        if (selectionStart != null)
                        {
                            string s = SelectedText();
                            if (s.Length > 0)
                            {
                                Clipboard.SetText(s);
                            }
                        }
                        e.SuppressKeyPress = true;
                    }
                    break;

                case Keys.V:
                    if (e.Control)
                    {
                        if (selectionStart != null)
                        {
                            DeleteSelection();
                        }
                        string cb = Clipboard.GetText();
                        foreach (char c in cb)
                        {
                            InsertCharacter(c);
                        }
                        e.SuppressKeyPress = true;
                    }
                    break;

                case Keys.A:
                    if (e.Control && selectable)
                    {
                        SelectAll();
                        e.SuppressKeyPress = true;
                    }
                    break;
                }
            }
            base.OnKeyDown(e);
        }
 public bool useKeyPress(System.Windows.Forms.KeyEventArgs ke)
 {
     return(false);
     //throw new NotImplementedException();
 }
Exemple #45
0
 private void listDMBD_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     mabd_Validated(null, null);
 }
Exemple #46
0
 public abstract void KeyDown(System.Windows.Forms.KeyEventArgs args);
Exemple #47
0
        private void frmSiparis_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F3)
            {
                txtBarkod.Focus();
                txtBarkod.SelectAll();
            }
            else if (txtBarkod.ContainsFocus == false)
            {
                if ((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) ||
                    (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9) ||
                    e.KeyCode == Keys.Decimal)
                {
                    txtBarkod.Focus();
                    txtBarkod.Select(txtBarkod.Text.Length, 0);
                    switch (e.KeyCode)
                    {
                    case Keys.NumPad0:
                        txtBarkod.Text = txtBarkod.Text + "0";
                        break;

                    case Keys.NumPad1:
                        txtBarkod.Text = txtBarkod.Text + "1";
                        break;

                    case Keys.NumPad2:
                        txtBarkod.Text = txtBarkod.Text + "2";
                        break;

                    case Keys.NumPad3:
                        txtBarkod.Text = txtBarkod.Text + "3";
                        break;

                    case Keys.NumPad4:
                        txtBarkod.Text = txtBarkod.Text + "4";
                        break;

                    case Keys.NumPad5:
                        txtBarkod.Text = txtBarkod.Text + "5";
                        break;

                    case Keys.NumPad6:
                        txtBarkod.Text = txtBarkod.Text + "6";
                        break;

                    case Keys.NumPad7:
                        txtBarkod.Text = txtBarkod.Text + "7";
                        break;

                    case Keys.NumPad8:
                        txtBarkod.Text = txtBarkod.Text + "8";
                        break;

                    case Keys.NumPad9:
                        txtBarkod.Text = txtBarkod.Text + "9";
                        break;

                    default:
                        txtBarkod.Text = txtBarkod.Text + Convert.ToChar((int)e.KeyValue).ToString();
                        break;
                    }
                    txtBarkod.Select(txtBarkod.Text.Length, 0);
                }
            }
        }
Exemple #48
0
 private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     game.KeyUp(e);
 }
Exemple #49
0
        private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            #region txtCustomerID
            if (sender == txtCustomerID)
            {
                if (e.KeyCode.ToString() == "F2")
                {
                    if (oCustomer.View())
                    {
                        txtCustomerID.Text = oCustomer.ID;
                        oCustomer.Find(txtCustomerID.Text);
                        //txtName.Text = oCustomer.Name;
                        this.AddItem();
                    }
                    return;
                }

                if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab)
                {
                    if (txtCustomerID.Text.Trim().Length == 0)
                    {
                        txtCustomerID.Focus();
                    }

                    if (oCustomer.Find(txtCustomerID.Text))
                    {
                        txtCustomerID.Text = oCustomer.ID;
                        //txtName.Text = oCustomer.Name;
                        this.AddItem();
                        txtCustomerID.Clear();
                        txtCustomerID.Focus();
                        return;
                    }
                }
            }
            #endregion
            #region Default Option
            //Default option
            switch (e.KeyCode)
            {
            case Keys.Tab:
                if (!e.Shift)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
                break;

            case Keys.Enter:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Down:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Up:
                this.SelectNextControl(this.ActiveControl, false, true, true, true);
                break;

            case Keys.F8:
                break;

            case Keys.F3:
                break;

            case Keys.F7:
                this.Close();
                break;

            case Keys.PageDown:
                btPrint_Click(null, null);

                break;


                //case Keys.<some key>:
                // ......;
                // break;
            }
            #endregion
        }
 public override void KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
 }
        private void cboxAddressList_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            try
            {
                //地址栏按键弹起事件
                if (cboxAddressList != null)
                {
                    if ((cboxAddressList.Text.Length > 0 & e.KeyCode == Keys.Enter))
                    {
                        if ((CheckIsUrlFormat(cboxAddressList.Text)))
                        {
                            browser = FindBrowser();

                            if (browserTabHeader1 != null)
                            {
                                //OutputDebugStringA("browserTabHeader1 != null");
                                if (browserTabHeader1.thMouseDownPublic != null)
                                {
                                    //OutputDebugStringA("browserTabHeader1.thMouseDown");
                                    browserTabHeader1.thMouseDownPublic.PageState = TabHeader.WebPageState.Loading;
                                }
                            }
                            cbtnbstopload.Visible = true;
                            cbtnbrefresh.Visible  = false;

                            if ((browser != null))
                            {
                                string strNewUrl = string.Empty;
                                string strCurUrl = string.Empty;
                                strCurUrl = browser.Url.ToString();
                                strNewUrl = cboxAddressList.Text.ToString();
                                if ((strCurUrl.Equals(strNewUrl)))
                                {
                                    cboxAddressList.Focus();
                                }
                                else
                                {
                                    browser.Url = strNewUrl;
                                }
                            }
                        }
                        else
                        {
                            // '使用百度API进行搜索
                            if (cboxAddressList.Text.Length <= 0)
                            {
                                return;
                            }

                            if ((browser != null))
                            {
                                try
                                {
                                    string strNewUrl = string.Empty;
                                    strNewUrl   = string.Format("https://www.baidu.com/s?wd={0}", cboxAddressList.Text.ToString());
                                    browser.Url = strNewUrl;
                                }
                                catch (Exception ex)
                                {
                                    //do something
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
 private void comboBoxBranches_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     GoIfEnterKey(sender, e);
 }
Exemple #53
0
 public void OnKeyUp(System.Windows.Forms.KeyEventArgs e)
 {
 }
Exemple #54
0
 void PythonEditor_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     updateCurrentWord(e);
     _handleKeyDown(sender, e);
 }
Exemple #55
0
 private void tb_downloadDlay_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     //e.KeyCode
 }
Exemple #56
0
        /// <summary> keyboard handling for shortcuts. </summary>
        private void MainForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (pendingCmd)
            {
                return;
            }

            if (e.KeyCode == Keys.P)
            {
                menuPbackPlay_Click(null, null);
                return;
            }

            if (playState == PlayState.Init)
            {
                return;
            }

            switch (e.KeyCode)
            {
            case Keys.A:
            {
                menuPbackPause_Click(null, null);
                break;
            }

            case Keys.S:
            {
                menuPbackStop_Click(null, null);
                break;
            }

            case Keys.D1:
            case Keys.Space:
            {
                menuPbackStepFw_Click(null, null);
                break;
            }

            case Keys.N:
            {
                menuPbackNextChapt_Click(null, null);
                break;
            }

            case Keys.R:
            {
                menuPbackPrevChapt_Click(null, null);
                break;
            }

            case Keys.F:
            {
                menuPbackFullscreen_Click(null, null);
                break;
            }

            case Keys.Escape:
            {
                if (fullScreen)
                {
                    ToggleFullScreen();
                }
                break;
            }

            case Keys.Home:
            {
                menuOptionRootMenu_Click(null, null);
                break;
            }

            case Keys.M:
            {
                menuOptionTitleMenu_Click(null, null);
                break;
            }

            case Keys.I:
            {
                menuOptionVideoAttr_Click(null, null);
                break;
            }

            case Keys.Left:
            {
                if ((menuMode == MenuMode.Buttons) && (dvdCtrl != null))
                {
                    dvdCtrl.SelectRelativeButton(DvdRelativeButton.Left);
                }
                break;
            }

            case Keys.Right:
            {
                if ((menuMode == MenuMode.Buttons) && (dvdCtrl != null))
                {
                    dvdCtrl.SelectRelativeButton(DvdRelativeButton.Right);
                }
                break;
            }

            case Keys.Up:
            {
                if ((menuMode == MenuMode.Buttons) && (dvdCtrl != null))
                {
                    dvdCtrl.SelectRelativeButton(DvdRelativeButton.Upper);
                }
                break;
            }

            case Keys.Down:
            {
                if ((menuMode == MenuMode.Buttons) && (dvdCtrl != null))
                {
                    dvdCtrl.SelectRelativeButton(DvdRelativeButton.Lower);
                }
                break;
            }

            case Keys.Enter:
            {
                if ((menuMode == MenuMode.Buttons) && (dvdCtrl != null))
                {
                    dvdCtrl.ActivateButton();
                }
                else if ((menuMode == MenuMode.Still) && (dvdCtrl != null))
                {
                    dvdCtrl.StillOff();
                }
                break;
            }
            }
        }
Exemple #57
0
        private void comboCommand_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            string text = comboCommand.Text;

            if (e.Shift && e.KeyCode.GetHashCode() == Keys.Left.GetHashCode())
            {
                int start;
                int pos = comboCommand.SelectionStart;

                if (e.Control)
                {
                    comboCommand.Text = text.Remove(0, pos);
                    e.Handled         = true;
                    return;
                }

                if (pos == 0)
                {
                    start = 0;
                }
                else
                {
                    start = text.LastIndexOf(",", pos - 1, pos);
                    if (start < 0)
                    {
                        start = 0;
                    }
                }

                int end = comboCommand.Text.IndexOf(",", pos);
                if (end < 0)
                {
                    end = text.Length;
                }

                int count = end - start;
                if (count > 0)
                {
                    comboCommand.Text           = text.Remove(start, count);
                    comboCommand.SelectionStart = pos < comboCommand.Text.Length ? pos : comboCommand.Text.Length;
                }
                e.Handled = true;
                return;
            }
            else if (e.Shift && e.KeyCode.GetHashCode() == Keys.Right.GetHashCode())
            {
                /*string[] items = treeCommand1.GetCommandsStartsWith(text);
                 * if (items.Length == 1 && items[0].Equals(text.ToUpper()) == false)
                 * {
                 *  if (items[0].IndexOf(" ") < 0) { comboCommand.Text = items[0] + " "; }
                 *  else { comboCommand.Text = items[0]; }
                 *  comboCommand.SelectionStart = comboCommand.Text.Length;
                 * }
                 * else
                 * {*/
                if (text.Length > 0)
                {
                    text = comboCommand.Text;
                    while (text.EndsWith(","))
                    {
                        text = text.Substring(0, text.Length - 1);
                    }

                    string next = commandCenter.NextAvailable(comboCommand.Text);
                    if (next.Length > 0)
                    {
                        if (text.IndexOf(" ") < 0)
                        {
                            text += " ";
                        }

                        comboCommand.Text           = text + next;
                        comboCommand.SelectionStart = comboCommand.Text.Length;
                    }
                }
                //}

                e.Handled = true;
                return;
            }
            else
            {
                FireActionEvent(sender, e);
                if (PagingKeyHandler(e.KeyCode, e.Shift, e.Control, e.Alt) == true)
                {
                    e.Handled = true;
                }
            }
        }
 private void txtInputSampleCode_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
 {
     if (e.KeyCode == System.Windows.Forms.Keys.Return)
     {
         if (this.CurrentFlowFlag != eFlowFlag.等待扫码)
         {
             return;
         }
         string barrelCode = this.txtInputSampleCode.Text.Trim();
         if (string.IsNullOrWhiteSpace(barrelCode))
         {
             return;
         }
         if (this.brotherRCSampleBarrels.Count == 0)
         {
             this.brotherRCSampleBarrels = this.czyHandlerDAO.GetRCSampleBarrels(barrelCode, out this.resMessage);
             if (this.brotherRCSampleBarrels.Count == 0)
             {
                 this.ShowMessage(this.resMessage, FrmMakeTake.eOutputType.Error);
                 this.txtInputSampleCode.ResetText();
                 return;
             }
             this.ShowMessage(this.resMessage, FrmMakeTake.eOutputType.Normal);
             this.CreateButtonX(this.brotherRCSampleBarrels.Count);
             this.ShowButton(this.brotherRCSampleBarrels.Count, "Sum", 0);
         }
         this.rCSampleBarrel = (from a in this.brotherRCSampleBarrels
                                where a.SampSecondCode == barrelCode
                                select a).FirstOrDefault <CmcsRCSampleBarrel>();
         if (this.rCSampleBarrel != null)
         {
             if (!this.IsScanedRCSampleBarrelId.Contains(this.rCSampleBarrel.Id))
             {
                 this.IsScanedRCSampleBarrelId.Add(this.rCSampleBarrel.Id);
                 this.ShowButton(this.IsScanedRCSampleBarrelId.Count, "Already", System.Convert.ToInt32(this.rCSampleBarrel.SampSecondCode.Substring(14, 2)));
                 if (this.IsScanedRCSampleBarrelId.Count < this.brotherRCSampleBarrels.Count)
                 {
                     this.ShowMessage(string.Concat(new object[]
                     {
                         "样桶编码:",
                         barrelCode,
                         ",还剩",
                         this.brotherRCSampleBarrels.Count - this.IsScanedRCSampleBarrelId.Count,
                         "桶未校验,请扫下个样桶"
                     }), FrmMakeTake.eOutputType.Normal);
                 }
                 else
                 {
                     foreach (CmcsRCSampleBarrel current in this.brotherRCSampleBarrels)
                     {
                         CmcsSampleBarrel cmcsSampleBarrel = Dbers.GetInstance().SelfDber.Entity <CmcsSampleBarrel>(" where BarrelCode='" + current.BarrelCode + "' ", null);
                         if (cmcsSampleBarrel != null)
                         {
                             cmcsSampleBarrel.IsUse = 0;
                             Dbers.GetInstance().SelfDber.Update <CmcsSampleBarrel>(cmcsSampleBarrel);
                         }
                     }
                     this.czyHandlerDAO.SaveHandSamplingReceive(this.brotherRCSampleBarrels[0].SamplingId, SelfVars.LoginUser.UserName, DateTime.Now);
                     this.ShowMessage("样桶编码:" + barrelCode + ",该批次样桶已全部校验成功", FrmMakeTake.eOutputType.Normal);
                 }
                 this.CurrentFlowFlag = eFlowFlag.等待校验;
                 return;
             }
             this.txtInputSampleCode.ResetText();
             this.ShowMessage("样桶编码:" + barrelCode + " 已校验,请扫下个样桶", FrmMakeTake.eOutputType.Error);
             return;
         }
         else
         {
             this.txtInputSampleCode.ResetText();
             this.ShowMessage("样桶编码:" + barrelCode + " 校验失败,请扫下个样桶", FrmMakeTake.eOutputType.Error);
         }
     }
 }
        private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            #region txtProductID
            if (sender == txtProductID)
            {
                if (e.KeyCode.ToString() == "F8")
                {
                    this.Grid.Focus();
                }

                if (e.KeyCode.ToString() == "F2")
                {
                    if (oOrder.oProduct.View(oOrder.oCustomer))
                    {
                        this.txtProductID.Text = oOrder.oProduct.ID;
                        return;
                    }
                }

                if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab)
                {
                    if (txtProductID.Text == "DONE")
                    {
                        txtProductID.Clear();
                        txtCollected.Enabled = true;
                        txtCollected.Focus();
                        return;
                    }


                    if ((txtProductID.Text.Length == 12 && oOrder.oProduct.FindByBarcode(txtProductID.Text)) || oOrder.oProduct.Find(txtProductID.Text))
                    {
                        Boolean HasBrochure = false;
                        foreach (BrochureByCustomer bc in oOrder.oCustomer.Brochures)
                        {
                            if (oOrder.oProduct.IsInBrochure(bc.BrochureID))
                            {
                                HasBrochure = true;
                                break;
                            }
                        }
                        if (!HasBrochure)
                        {
                            Global.playSimpleSound();
                            txtDescription.Text = "This Product Belongs to Other Brochure";
                            return;
                        }


                        this.IDetail.ProductID   = oOrder.oProduct.ID;
                        this.IDetail.Price       = oOrder.oProduct.ExtendedPrice(oOrder.oCustomer);
                        this.IDetail.Description = oOrder.oProduct.Description.ToString();
                        this.IDetail.Length      = oOrder.oProduct.Length;
                        this.IDetail.Width       = oOrder.oProduct.Width;
                        this.IDetail.Height      = oOrder.oProduct.Height;

                        this.txtProductID.Text   = oOrder.oProduct.ID;
                        this.txtDescription.Text = oOrder.oProduct.Description;



                        AddItem();
                        ActiveRow();
                        txtProductID.Focus();
                    }
                    else
                    {
                        Global.playSimpleSound();
                    }
                    this.txtProductID.Focus();
                    this.txtProductID.Clear();
                    return;
                }
            }
            #endregion

            #region txtCollected
            if (sender == this.txtCollected)
            {
                if (oOrder.Collected != txtCollected.Number)
                {
                    oOrder.Collected = txtCollected.Number;
                    getTotals();
                }

                if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.Return)
                {
                    if (!oOrder.oCustomer.Find(CustomerID))
                    {
                        MessageBox.Show("Please enter a valid Customer ID/School ID ");
                        return;
                    }

                    if (Math.Abs(oOrder.Diff) > 0 && !IsDiff)
                    {
                        Global.playSimpleSound();
                        IsDiff = true;
                    }
                    else
                    {
                        IsDiff = false;
                    }

                    Save();
                    Clear();
                    txtCollected.Enabled = false;
                    txtProductID.Focus();
                    return;
                }
            }
            #endregion

            #region Grid
            if (sender == this.Grid)
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (Grid.ActiveRow != null)
                    {
                        if (Grid.ActiveCell != null)
                        {
                            if (!Grid.ActiveCell.IsInEditMode)
                            {
                                //' set ActiveCell
                                Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"];
                                Grid.PerformAction(UltraGridAction.EnterEditMode, false, false);
                                return;
                            }
                            else
                            {
                                Grid.PerformAction(UltraGridAction.ExitEditMode, true, true);
                                return;
                            }
                        }
                        else
                        {
                            Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"];
                            Grid.PerformAction(UltraGridAction.EnterEditMode, false, false);
                            return;
                        }
                    }
                }

                if (e.KeyCode == Keys.Down)
                {
                    Grid.PerformAction(UltraGridAction.BelowRow, false, false);
                    return;
                }
                if (e.KeyCode == Keys.Up)
                {
                    Grid.PerformAction(UltraGridAction.AboveRow, false, false);
                    return;
                }


                /*
                 * if (e.KeyCode.ToString()=="Delete")
                 *             {
                 *                     this.DeleteItem(false);
                 *                     return;
                 *             }*/
                if (e.KeyCode.ToString() == "F8")
                {
                    this.txtProductID.Focus();
                    return;
                }
            }

            #endregion

            #region Default Option
            //Default option
            switch (e.KeyCode)
            {
            case Keys.Tab:
                if (!e.Shift)
                {
                    this.SelectNextControl(this.ActiveControl, true, true, true, true);
                }
                break;

            case Keys.Enter:
                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Down:

                this.SelectNextControl(this.ActiveControl, true, true, true, true);
                break;

            case Keys.Up:

                this.SelectNextControl(this.ActiveControl, false, true, true, true);
                break;

            case Keys.F8:
                this.Grid.Focus();
                break;

            case Keys.F5:
            {
                Clear();
                txtProductID.Focus();
            }

            break;

            case Keys.F12:
            {
                oOrder.Find(oOrder.GetLastID());
                ShowOrder();
            }

            break;

            case Keys.F3:
                deleteOrder();
                break;

            case Keys.PageDown:
                this.Save();
                txtProductID.Clear();
                txtCollected.Enabled = true;
                txtCollected.Focus();
                return;

                //case Keys.<some key>:
                // ......;
                // break;
            }
            #endregion
        }
Exemple #60
0
 void ISystemBase.OnKeyUp(System.Windows.Forms.KeyEventArgs e)
 {
 }