Introduction
Every coding person must wonder how the controls might be used in their application and what purpose they are going to serve. For such coders, I have shared my simple knowledge of using Timer control which is a basic but important control that can be used in an effective way to showcase their application.
Every coding person must wonder how the controls might be used in their application and what purpose they are going to serve. For such coders, I have shared my simple knowledge of using Timer control which is a basic but important control that can be used in an effective way to showcase their application.
Procedure
The below given steps will help you to develop a Traffic Control application which works for single side direction.
Step 1
We need Visual Studio for developing our application, and in my case I have used VS 2010 for its simplicity.
We need Visual Studio for developing our application, and in my case I have used VS 2010 for its simplicity.
Step 2
The user has to open up Visual Studio and select a fresh project using the steps in the below picture.
The user has to open up Visual Studio and select a fresh project using the steps in the below picture.

Step 3
By selecting a new project you will be opened up with a new window where all the developing templates are available as options. Here you can select C# Windows Form application and save the application name. After typing the application name select OK which will take you into the Windows work area.
By selecting a new project you will be opened up with a new window where all the developing templates are available as options. Here you can select C# Windows Form application and save the application name. After typing the application name select OK which will take you into the Windows work area.

Step 4
After entering the Windows work area now we need the control ingredients to make our application into an interactive one. I have included the following controls in my form.
After entering the Windows work area now we need the control ingredients to make our application into an interactive one. I have included the following controls in my form.
- Picture Box (3 nos)
- Label (1)
- Text box (1)
- Timer control (2 nos)

Step 5
To fill the picture box with some images I have picked specific traffic control pictures which are available on the Internet and used them inside my application.The below given image shows the sample pictures which I chose from the Internet for my use.
Step 6
The thing to be noted here is I have placed 3 picture boxes and they are placed one above the other and look like as if there is only one single picture box inside the form.
To fill the picture box with some images I have picked specific traffic control pictures which are available on the Internet and used them inside my application.The below given image shows the sample pictures which I chose from the Internet for my use.
Step 6
The thing to be noted here is I have placed 3 picture boxes and they are placed one above the other and look like as if there is only one single picture box inside the form.
Step 7
The use of text box is to display some text while the signal is in a particular color. This is just to make the application more productive. The use of Label is to display the time for which a particular color in the signal would last. Since there are three different colors they have to be controlled according to time slot.
The use of text box is to display some text while the signal is in a particular color. This is just to make the application more productive. The use of Label is to display the time for which a particular color in the signal would last. Since there are three different colors they have to be controlled according to time slot.
Step 8
The true magic of this application is with the use of timer control which i have used 2 here for two purposes. One is for making the image take turns in displaying and the other for displaying the counter number which runs in reverse order inside a label. The properties to be changed for the timer are given in the below picture. Thing to be noted is,
The true magic of this application is with the use of timer control which i have used 2 here for two purposes. One is for making the image take turns in displaying and the other for displaying the counter number which runs in reverse order inside a label. The properties to be changed for the timer are given in the below picture. Thing to be noted is,
- Timer --> enabled is true.
- Timer --> interval is in thousands (x 1000) since one second is represented in 1000 milliseconds.

Step 9
After placing the controls in the right place inside the windows form and applying the below given code into the controls we could get the running traffic signal application without any errors.
After placing the controls in the right place inside the windows form and applying the below given code into the controls we could get the running traffic signal application without any errors.

Erick KoechPosted Oct 1, 2018, 3:33 AM
Its a nice article,,please help me with an article that will help me develop an application for fuel consumption
Munish APosted Oct 25, 2017, 11:32 PM
Nice article sir...............