private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if (char.ToUpper(e.KeyChar) == 'P') { if (flag) { label2.Visible = true; RoadMover.Stop(); Right_mover.Stop(); Left_mover.Stop(); enemy1_mover.Stop(); enemy2_mover.Stop(); enemy3_mover.Stop(); enemy4_mover.Stop(); flag = false; } else { label2.Visible = false; RoadMover.Start(); Right_mover.Start(); Left_mover.Start(); enemy1_mover.Start(); enemy2_mover.Start(); enemy3_mover.Start(); enemy4_mover.Start(); flag = true; } } }
private void Consultas_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Right) { Right_mover.Start(); } if (e.KeyCode == Keys.Left)//mirar que el boton el panel de consultas este enable o dissable { Left_mover.Start(); } }
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Left) { Left_mover.Start(); } if (e.KeyCode == Keys.Right) { Right_mover.Start(); } }