Details:
- Draw the form above.
- Name the form frmTraffic.
- Set the form's Text property to "Traffic
Light"
- The traffic light is made up of one label object as a background and three other label objects drawn on top. Name them lblBack,
lblTop, lblMiddle and lblBottom.
- Set the backcolor of the background label to a dark green and the other three labels drawn on top to black.
- There are four buttons on the right. Name them btnStop, btnCaution, btnGo, and btnQuit.
- Set the text on each as shown.
- Double click on the "Stop" button to activate the code window.
- Add code that will make the lblTop become red when the click event for the button btnStop executes.
- Add code that will make the lblMiddle become yellow when the click event for the button btnCaution executes.
- Add code that will make the lblBottom become green when the click event for the button btnGo executes.
- Can you make the light behave like a real traffic light so that only the red, yellow or green lights are on? (The other two will be off or black.)
- Save this form to your floppy disk or other media.
|