C# (CSharp) Class System.Windows.Forms. KeyEventArgs Code Examples

C# (CSharp) System.Windows.Forms.KeyEventArgs - 30 examples found. These are the top rated real world C# (CSharp) examples of class System.Windows.Forms.KeyEventArgs extracted from open source projects. You can rate examples to help us improve the quality of examples
Inheritance: System.EventArgs
Example #1
0
 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();
 }
 /// <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;
 }
 private void FormViewerMARKETING_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         Close();
     }
 }
Example #4
0
 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);
 }
Example #5
0
 private void button5_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData==Keys.Right)
     {
         wplayer.controls.fastReverse();
     }
 }
Example #6
0
 private void TemplateName_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode == Keys.Enter) {
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
 }
 private void textBoxQuantity_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         this.textBoxBarCode.Focus();
     }
 }
Example #8
0
 private void txtTitle_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         btnOkay_Click(null, null);
     }
 }
Example #9
0
 private void numJug_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         this.Iniciar();
     }
 }
 private void MaskedTextBoxKeyDown_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SendKeys.Send("{TAB}");
     }
 }
Example #11
0
 private void txtPassword_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         btnLogin_Click(null, null);
     }
 }
Example #12
0
 private void ContrasenatextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         IniciarSesion();
     }
 }
Example #13
0
 private void lvProgramm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         RemoveSelected();
     }
 }
 private void FormKeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }
Example #15
0
 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;
         //}
     }
 }
Example #16
0
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
     {
         this.Close();
     }
 }
Example #17
0
 private void FilterTemplateName_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode == Keys.Escape) {
         this.DialogResult = DialogResult.Cancel;
         this.Close();
     }
 }
Example #18
0
 private void Add_Ecip_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Close();
     }
 }
Example #19
0
 private void ItemReturnFrm_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode==Keys.F4)
     {
         KeyF4();
     }
 }
Example #20
0
        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);
                }

        } 
Example #21
0
 void txtEditor_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Tab)
     {
         txtEditor_Leave(sender, e);
     }
 }
 private void archiveList_KeyDown(object sender, KeyEventArgs e)
 {
     if ((e.KeyCode == Keys.Delete) && archiveList.SelectedItems.Count > 0)
     {
         DeleteThought();
     }
 }
Example #23
0
 private void button4_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData==Keys.Left)
     {
         wplayer.controls.fastForward();
     }
 }
Example #24
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;
     }
 }
Example #25
0
        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());
            }
        }
Example #26
0
 private void BaseForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Hide();
     }
 }
Example #27
0
 //Método KeyDown
 private void txtsenha_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyValue == 13) //13 é ENTER (ASCII)
     {
         btnLogin_Click(sender, e);
     }
 }
 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;
 }
        /// <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;
        }
Example #30
0
 private void checkedListBox1_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Delete)
     {
         removeButton_Click(null, null);
     }
 }