Traffic Light with user defined timeframes.
I am trying to create a traffic light that collects user inputs to run the lights. I want to use graphics methods to draw the traffic light. The user will enter the number of seconds each light will stay lit. I have a start button to start the light and a stop button to stop the light. The lights will start one after the other and continue to run until the stop button is clicked. I have no clue at where I should begin.
Joel MackPosted Mar 6, 2011, 11:31 AM
FroglegPosted Mar 2, 2011, 2:51 PM
2: To set a timer interval - tRed.Interval = Convert.ToInt32(txtRed.Text);
3: To draw an ellipse use in the grbxTrafficLight_Paint event
Rectangle rctRed = new Rectangle (25,20,40,40);
e.Graphics.FillEllipse(Brushes.Red, rctRed);
4: Create three booleans redOn, greenOn, etc
5: When timer times out change boolean to true or false
See if you can work it out from here