Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Friday, June 3, 2011

VB-16 : Print using Timer

Refer  Print your name on the form also.


(1) : When we give 1000 as interval for the timer, it will work in each second by displaying the message box.

A)   Property :
Timer : NAME-Timer1, INTERVAL-1000

B)   Attaching Code to the Object :

Private Sub Timer1_Timer()
MsgBox ("Hello")
End Sub
C)   Output:
(Only after pressing the Ok button,we will get the next message box, and End will terminate the program)
=========================================================================


(2): When we give 1000 as interval for the timer, it will work in each second by printing “Hello”

A)   Property :
Timer : NAME-Timer1, INTERVAL-1000

B)   Attaching Code to the Object :

Private Sub Timer1_Timer()
Print "Hello"
End Sub

C)   Output:


=========================================================================

(3)        : When we give 1000 as interval for the first timer,and 5000 for the second timer , the first timer  will work in each second by printing “Hello”and the second timer will work in each 5 seconds by printing “Welcome”

A)   Property :
Timer : NAME-Timer1, INTERVAL-1000
Timer : NAME-Timer2,, INTERVAL-5000

B)   Attaching Code to the Object :

Private Sub Timer1_Timer()
Print "Hello"
End Sub

Private Sub Timer2_Timer()
Print "Welcome"
End Sub
C)   Output:


=========================================================================


Back to Home   &  VB

No comments: