Timer control in Visual Basic 6.0


The Timer control  is used to fire an event at soecified intervals.The code you want to execute is placed in this event. This control has no methods,only one event(Time event)and seven properties.The control is invisible at run time.

1.  Start -> program-> Microsoft Visual Studio 6.0 -> Microsoft Visual Basic 6.0

2.  Visual Basic load and appears on your screen.

3.  Choose Standard Exe. From dialog box.

4.  A form1 container is open.

5.  Add one Label1,Command1 button and Timer1 control on the form1.

 

 

 

 

 

 

 

6. Set the time property “2000”  for Timer1 control.

7. Double click on timer control.The code window is open.Write the code here.

 

 

 

 

 

8. Run your program. Click “Debug” from the menu bar. Click “Start” from the drop down menu. Alternatively, you can press <F5> on your keyboard.Output is:

 

 

 

 

 

9. Time is start when you rum the program.when time is complete the caption of Label1 and command1 button is change.As shown in Figure below:

 

 

 

Comments are closed.