private void Red_Timer_Tick(object sender, EventArgs e) { pictureBox1.Image = Lights[0]; Red_Timer.Stop(); Yellow_Timer.Stop(); Green_Timer.Start(); }
private void TimerInit() { green_duration.Value = Durations[0]; yellow_duration.Value = Durations[1]; red_duration.Value = Durations[2]; Green_Timer.Stop(); Green_Timer.Interval = Durations[0] * 1000; Yellow_Timer.Stop(); Yellow_Timer.Interval = Durations[1] * 1000; Red_Timer.Stop(); Red_Timer.Interval = Durations[2] * 1000; Red_Timer.Start(); pictureBox1.Image = Lights[2]; }