Hello I am in need of some assistance. I have a form with three textboxes, I also programmatically created the traffic light simulation red, yellow and green.
I also have a timer control which I am stuck with and don't know what to do.
can you please assist me? Thanks.
Bravo
Loading
Amit ChoudharyPosted Apr 28, 2010, 1:13 PM
Sorry for late reply i was busy from last few days.... i have modified your project add the Tick_event of timer and used switch case to check the values of textboxes and give the spcified time to the intervals..
Download the attach project
Please mark as answer if it helps you.
Gregory CoderPosted Nov 26, 2014, 6:04 AM
pavan kumarPosted Oct 19, 2012, 8:08 AM
coming to another issue of mine.
how to set auto increment of field value which is an nvarchar in sql server.
Amit ChoudharyPosted Apr 29, 2010, 3:44 AM
Desi BravoPosted Apr 28, 2010, 10:01 PM
I really do appreciate for your assistance. Umm, its very close I have previously tried the switch statement but it work for me with the interval but now it did for you. It is very close I like it but does not render clearly it flickers all colors. It looks likeis going hay wire LOL. But i think I can take form there. this is the hardest i've encountered so far. Very challenging. Traffic light actually starts from red to green to yellow to red, or from green to yellow to red then back to green.
Thanks Again Amit,
Sincerely,
Desi Bravo
Desi BravoPosted Apr 23, 2010, 12:10 AM
Attached is the correct file with the graphics and the textboxes.
I would need to have the tick event, the timer interval for every text box that represents the traffic light color. If you can help me just by giving me one line of code I can do the rest of the program. I just don't know how to use the if statement to have the lights appear and switch to the next light within the specified milliseconds of each textbox. Dont know if I need nested if statements. Can you help, thanks.
Amit ChoudharyPosted Apr 22, 2010, 11:21 PM
Desi BravoPosted Apr 22, 2010, 12:08 PM
I do appreciate for your assistance but it's incorrect. Sure it does work but not how it suppose to be. That is why i sent you the files.
My form has three textboxes, for red, yellow and green. In each textbox i have to enter a number from 1-20 with a timer in milliseconds. So my timer interval is 10000 for green, timer interval 3000 for yellow and timer interval for red is 10000 milliseconds. :)
I enter 3 in txtRed.Text, 2 in txtYellow.Text and 20 in txtGreen.Text. This simulate a traffic light turning from red to green and green to yellow to red. I previously mentioned that. You have if I click on the form the lights changes. I already have a button to do the same thing.
The traffic light button suppose to activate the textboxes to the lights.
As I enter the proper numbers to the textbox and click on the traffic light button it activates and the traffic lights simulate the actual traffic light.
Desi
Amit ChoudharyPosted Apr 22, 2010, 3:15 AM
Download the project i have modified it and now its working..
Now i want you to please mark my post as answer by checking the "Do you like this post?" check box.
Desi BravoPosted Apr 21, 2010, 12:34 PM
Amit ChoudharyPosted Apr 20, 2010, 11:31 PM
send me your project files i can help you...