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-11 : Set Focus(If-Then-Endif)

To run more than one line of code,you must use multiple line(or block)syntax.
This syntax includes the ENDIF statements;


A)   Property :
Text Box (Same as VB-10)


B)   Attaching Code to the Object :


Private Sub Text1_LostFocus()
If Text1.Text = " " Then
MsgBox "Sorry!name cannot be left blank"
chance = chance + 1
Text1.SetFocus
End Sub


Refer : VB-10 : Set Focus(If-Then)



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

No comments: