Exemplo n.º 1
0
        private void DirectionControler(Keys key)
        {
            MoveFormTimer.Start();

            switch (key)
            {
            case Keys.Right:
                moving = MoveDirection.Right;
                break;

            case Keys.Left:
                moving = MoveDirection.Left;
                break;

            case Keys.Up:
                moving = MoveDirection.Up;
                break;

            case Keys.Down:
                moving = MoveDirection.Down;
                break;

            case Keys.Enter:
                CenterToScreen();
                MoveFormTimer.Stop();
                break;
            }
        }
Exemplo n.º 2
0
 private void WindowMovingForm_KeyDown(object sender, KeyEventArgs e)
 {
     MoveFormTimer.Start();
     DirectionControler(e.KeyCode);
 }