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

Wednesday, August 10, 2011

VB-100 : To give a Message to the user

Program to give a Message to the user (Program to call a Message function Box)
Taken from VB-Tutorial CDs ...



(A)Program Design : 


(B) Property(Controls Used
  • One Command Button with Name - Command1 and Caption - Show
(C) Attaching Code to the Object :

Private Sub Command1_Click()
Dim x As Integer
x = MsgBox("Do you wish to continue..?", vbYesNoCancel)
If x = vbYes Then
MsgBox ("YES button clicked")
ElseIf x = vbNo Then
MsgBox ("NO button clicked")
Else
MsgBox ("CANCEL button clicked")
End If
End Sub


(D) Output :



Click Show .Then a message box will appear as :



There are 3 options as Yes , No and Cancel.
Click any one of them (say , Yes) .Then another box will appear as :


 
(E) Errors :

If found any errors while running your VB program, or want to put your comment about any  program , please click Comment section , to post.


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

    No comments: