SEB’s VB.NET Guide
Accepting User Input
Basic Text
1.Add a text box2.Delete the text in the text property3.Write the code to process the user input:
What do you want to activate the code? Use a
form_load
to automatically run thecode or a
command
#
_click
to run it when the user clicks the command button.
(The sub will be created for you if you double-click on the command button or the form)
Example:
Private Sub Command
1
_Click If
Text1.Text = “Hello!”
Then
Text1.Text = “Welcome”
ElseIf
Text1.Text = “Good-bye”
Then
Text1.Text = “See ya!”
Else
Text1.Text = “Sorry. I don’t understand.”
End If End Sub
List Boxes, Check Boxes, Combos & OptionButtons
List Boxes:
List boxes allow the user to select from several options in a box.The user can only choose one from the selected list.
Check Boxes
Check boxes allow the user to tick the options they want to choose. They canselect more than one box.
Page 1 of 3
Add a Comment