private void BTNStart_Click(object sender, EventArgs e) { if (BTNStart.Text == "Start") { TimerSimulation.Start(); BTNStart.Text = "Stop"; } else { TimerSimulation.Stop(); BTNStart.Text = "Start"; } }
private void btnPlay_Click(object sender, EventArgs e) { if (!play) { btnToggleLight.Enabled = true; TimerSimulation.Interval = 1000; TimerSimulation.Start(); Play(); count = Simulation.TotalNumberCars; Simulation.StartTimers(); } else if (play) { Stop(); } }