This program does not allow the user to move out of the text box till the user enters some value in it.
This example omits the ELSE and the END IF keywords.
Note : To run more than one line of code,we must includes the ENDIF statements.Refer VB-11 : Set Focus(If-Then-Endif) in which we are using ENDIF
==========================================
Refer : VB-11 : Set Focus(If-Then-Endif)
=========================================================================
Back to Home & VB
This example omits the ELSE and the END IF keywords.
A) Property :
Text Box : NAME-Text1, TEXT-(Should be kept blank) |
B) Attaching Code to the Object :
Private Sub Text1_LostFocus() If Text1.Text = " " Then MsgBox "Sorry!name cannot be left blank" Text1.SetFocus End Sub |
Note : To run more than one line of code,we must includes the ENDIF statements.Refer VB-11 : Set Focus(If-Then-Endif) in which we are using ENDIF
==========================================
Refer : VB-11 : Set Focus(If-Then-Endif)
=========================================================================
Back to Home & VB
No comments:
Post a Comment