Print the Name on the form , through the message box appeared.
Taken from VB-Tutorial CDs ...
(A)Program Design :
(B) Property(Controls Used) :
- One Command Button with Name as Command1 and Caption as Show
(C) Attaching Code to the Object :
Private Sub Command1_Click() Dim sn As String sn = InputBox("Enter your name to print that on the Form ", "Name", "Visual Basic") Print sn End Sub |
(D) Output :
Click "Show".Then another Dialog Box will appear as :
In the above Picture , Visual Basic is the default Name.We can change it , if we want...
Change the Name , and Click OK as per the picture given above :
Then we can see that ; the Name is printed on the Form.
Again , Click ,Show to add another Name.
(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.
- ====================================================================
No comments:
Post a Comment