private void D_timer_Tick(object sender, EventArgs e) { if (D_x == A_x - 20 && D_y == A_y - 20) { D_timer.Stop(); } else { do { if (D_x < A_x) { D_x++; } else { D_x--; } }while (D_x == A_x - 20); do { if (D_y < A_y) { D_y++; } else { D_y--; } }while (D_y == A_y - 20); Invalidate(); } }
private void button1_Click(object sender, EventArgs e) { A_timer.Stop(); B_timer.Stop(); C_timer.Stop(); D_timer.Stop(); }