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; } }
private void WindowMovingForm_KeyDown(object sender, KeyEventArgs e) { MoveFormTimer.Start(); DirectionControler(e.KeyCode); }