|
By Kardi Teknomo, PhD.
<VB Tutorial | Contents | Previous | Next >
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 into Form
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.
<VB Tutorial | Contents | Previous | Next >
Rate this tutorial or give your comments about this tutorial
This tutorial is copyrighted.
Preferable reference for this tutorial is
Teknomo, Kardi. Visual Basic Tutorial . http:\\people.revoledu.com\kardi\
tutorial\VB
|