private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (x == 0)
{
timerstart.Stop();
kaishi();
x++;
}
else
{
if (zanting == 1)
{
if (e.KeyCode.ToString() == "P")
{
picfeiji.Visible = true;
timeryunshi.Start();
timerzdyz.Start();
timerzanting.Stop();
labzanting.Visible = false;
zanting = 0;
}
else
{
e.Handled = true;
}
}
else
{
if (e.KeyCode.ToString() == "P")
{
if (zanting == 0)
{
timeryunshi.Stop();
timerwudi.Stop();
timerup.Stop();
timerleft.Stop();
timerright.Stop();
timerdown.Stop();
timerzidan.Stop();
timerzdyz.Stop();
labzanting.Visible = true;
timerzanting.Start();
zanting = 1;
{
if (x == 0)
{
timerstart.Stop();
kaishi();
x++;
}
else
{
if (zanting == 1)
{
if (e.KeyCode.ToString() == "P")
{
picfeiji.Visible = true;
timeryunshi.Start();
timerzdyz.Start();
timerzanting.Stop();
labzanting.Visible = false;
zanting = 0;
}
else
{
e.Handled = true;
}
}
else
{
if (e.KeyCode.ToString() == "P")
{
if (zanting == 0)
{
timeryunshi.Stop();
timerwudi.Stop();
timerup.Stop();
timerleft.Stop();
timerright.Stop();
timerdown.Stop();
timerzidan.Stop();
timerzdyz.Stop();
labzanting.Visible = true;
timerzanting.Start();
zanting = 1;