private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Equals("{ENTER}")) { reply("Pressed enter."); } }
private void Form_game_KeyDown(object sender, KeyEventArgs e) { if (e.Equals(repeat)) { return; } repeat = e; switch (e.KeyCode) { case Keys.Left: player1.dirLeft = true; break; case Keys.Right: player1.dirRight = true; break; case Keys.Down: player1.dirDown = true; break; case Keys.Up: player1.dirUp = true; break; } PlayerMove(); timer_move.Start(); }
private void durrationNumericUpDown_KeyDown(object sender, KeyEventArgs e) { if (e.Equals(Keys.Enter)) { MessageBox.Show("Hello"); } }
/// <summary> /// Handles KeyDown event. Returns true if a component accepted and handled the event. /// </summary> public virtual bool KeyDown(KeyEventArgs e) { if (e.Equals(_config.GetConsoleKey())) { _console.ToggleVisible(); return(true); } if (_console.IsVisible()) { if (_console.KeyDown(e)) { return(true); } } IOrderedEnumerable <IGuiComponent> inputList = from IGuiComponent comp in _components where comp.RecieveInput orderby comp.ZDepth ascending orderby comp.IsVisible() descending //Invisible controls still recieve input but after everyone else. This is mostly for the inventory and other toggleable components. orderby comp.Focus descending select comp; return(inputList.Any(current => current.KeyDown(e))); }
private void SearchBox_KeyUp(object sender, KeyEventArgs e) { if (e.Equals(Key.Enter)) { btnFill(sender, e); } }
private void txtbSearch_KeyDown(object sender, KeyEventArgs e) { if (e.Equals("{ENTER}")) { listBox1.Items.Clear(); foreach (userMessages mess in goog.allMessages.Values) { if (mess.TITLE.Contains(txtbSearch.Text)) { listBox1.Items.Add(mess); } } } }