|
|
 |
'Learn how to use select case (also known as switch case).
Dim num As Integer
Dim strReply As String
Private Sub Form_Load()
Label1.Caption = "The number between 0 - 3."
End Sub
Private Sub Command1_Click()
num = Int(Text1.Text)
Select Case (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."
Case Default 'none of the above
strReply = "You typed in number zero"
End Select
'display our comment
Label1.Caption = strReply
End Sub
|
 |
Visual Basic Source Code |
I hope you found this Visual Basic tutorial useful!
Don't forget to mention Apron Tutorials in your References!
Best Regards
Ronny André Reierstad
|
|
|