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, May 27, 2011

VB-8 : Print "Hello" 10 times(Do-While)


Refer Print name 10 times(For-Next Loop) also.

We need 2 command buttons.
The output will print "Hello" 10 times(Do-While Loop)

A)   Property :
Command button : NAME- Command1 , CAPTION- Click
Command button : NAME- Command2 , CAPTION- Exit




B)   Attaching Code to the Object :
Private Sub Command1_Click()
Dim num, count
num = 10
count = 0
Do While count < num
Print "Hello"
count = count + 1
Loop
End Sub

Private Sub Command2_Click()
End
End Sub


=============================================
Back to Home   &  VB

No comments: