Question: Simulate a traffic light using three small square text boxes stacked vertically. When the program starts, the bottom textbox should have focus and its background

Simulate a traffic light using three small square text boxes stacked vertically. When the program starts, the bottom textbox should have focus and its background color should be green. The other two textboxes should have a gray background color.

Pressing the Tab key should move focus into the top textbox. When the top textbox has focus, code in its Enter event it should set its background color to red and the background color of the other two textboxes to gray.

The next time Tab is pressed, the middle textbox should receive focus. Code in its Enter event should change its background color to yellow and the background color of the two textboxes to gray.

Pressing the Tab key a second time should set focus back to the bottom textbox. Code in its Enter event should set its background color to green and the background color of the other two textboxes to gray.

Please give each control an appropriate name. Remember to prefix all textbox names with txt.

(this is done is visual basics on microsoft visual studio)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!