コード例 #1
0
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Equals("{ENTER}"))
     {
         reply("Pressed enter.");
     }
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 private void durrationNumericUpDown_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Equals(Keys.Enter))
     {
         MessageBox.Show("Hello");
     }
 }
コード例 #4
0
        /// <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)));
        }
コード例 #5
0
 private void SearchBox_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Equals(Key.Enter))
     {
         btnFill(sender, e);
     }
 }
コード例 #6
0
        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);
                    }
                }
            }
        }