By Kardi Teknomo, PhD .

< Previous | Next | VB Tutorial | Contents >

Visual Basic (VB) Text Box

In the previous lesson , you have learnt about input and output using InputBox nd messageBox. If you want to input only one time, you can use InputBox. However, if you want to input several times or lazy to input every time, you can use text box.

1. Drag and drop Text Box Kardi Teknomo's Visual Basic (VB) Tutorial into Form
text box property 2. In the property window, change the Text property of Text box into your name
3. Double click the command button again to enter to code mode
4. Delete the command about InputBox and replace with Text1.text, become:

Private Sub Command1_Click()
Dim myName
myName = Text1.Text
MsgBox "Hello " & myName
End Sub

5. Run the program (F5)

Notice the intellisense also provides auto-label when you type a period after Text1. You do not need to memorize the methods and properties in VB, if you type the name correctly, it will be shown to you.

< Previous | Next | VB Tutorial | Contents >

Rate this tutorial or give your comments about this tutorial

This tutorial is copyrighted .