'Learn how to use select case (also known as switch case).PublicClass Form1
Inherits System.Windows.Forms.Form
Dim num AsIntegerDim strReply AsStringPrivateSub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) HandlesMyBase.Load
Label1.Text = "The number between 0 - 3."EndSubPrivateSub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
num = Int(TextBox1.Text)
SelectCase (num)
Case 1
strReply = "You typed in number one."Case 2
strReply = "You typed in number two."Case 3
strReply = "You typed in number three."CaseElse'none of the above
strReply = "You typed in zero or other"EndSelect'display our comment
Label1.Text = strReply
EndSubEndClass
Visual Basic .Net Source Code
I hope you found this VB .Net tutorial useful!
Don't forget to mention Apron Tutorials in your References!