public static void plusVoiture(VoiturePlan1Manuel c) { if (nbVoitureCree < nVmax) { tV[nbVoitureCree] = c; } else { nVmax += 40; VoiturePlan1Manuel[] aux = new VoiturePlan1Manuel[nVmax]; for (int i = 0; i < nbVoitureCree; i++) { aux[i] = tV[i]; } tV = aux; tV[nbVoitureCree] = c; } nbVoitureCree++; }
private void button4_Click(object sender, EventArgs e) { VoiturePlan1Manuel c = new VoiturePlan1Manuel("gauche"); Plan1Manuel.plusVoiture(c); axWindowsMediaPlayer1.URL = "beepCar.mp3"; }