Hitterman
25-08-08, 06:28 PM
In this tutorial we will learn how to make a small Visual Basic program which will print any text entered in a Text box.
To start with..
1) Open Visual basic and create a new Project of "Standard.EXE" type.
2)Now from the toold Menu create a new Text Box.
http://www.tutorialistic.net/tutorials/vb1.jpg
3)Now again from the Tools menu create a Command Button.
http://www.tutorialistic.net/tutorials/vb2.jpg
4) Now double Click the button to add Commands.
Below
Private Sub Command1_Click() and End Sub,
Add the following command
MsgBox(Text1)
Where text one is the "Name" of the Text box.
http://www.tutorialistic.net/tutorials/vb3.jpg
5) Execute the EXE! Enter any text in the text box and click on the Command button. You will see it working.
http://www.tutorialistic.net/tutorials/vb4.jpg
Special Tip:: Using my previous VB tutorial and this one, you can combine it and Print a custom + Predifined message.
Just use this command
MsgBox("Predefined command in the code" + Textbox_name)
Example:
MsgBox("Hello" + Text1)
Hope this tutorial is a well explained.
To start with..
1) Open Visual basic and create a new Project of "Standard.EXE" type.
2)Now from the toold Menu create a new Text Box.
http://www.tutorialistic.net/tutorials/vb1.jpg
3)Now again from the Tools menu create a Command Button.
http://www.tutorialistic.net/tutorials/vb2.jpg
4) Now double Click the button to add Commands.
Below
Private Sub Command1_Click() and End Sub,
Add the following command
MsgBox(Text1)
Where text one is the "Name" of the Text box.
http://www.tutorialistic.net/tutorials/vb3.jpg
5) Execute the EXE! Enter any text in the text box and click on the Command button. You will see it working.
http://www.tutorialistic.net/tutorials/vb4.jpg
Special Tip:: Using my previous VB tutorial and this one, you can combine it and Print a custom + Predifined message.
Just use this command
MsgBox("Predefined command in the code" + Textbox_name)
Example:
MsgBox("Hello" + Text1)
Hope this tutorial is a well explained.