Created
December 12, 2013 17:34
-
-
Save jda0/7932002 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
' Form controls: TextBox TextBox1, Label Label1 | |
Private opt As Integer | |
Private names(9) As String | |
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load | |
names = {"Andrew", "Brian", "Charles", "David", "Edward", "Finn", "George", "Harry", "Ian", "John"} | |
TextBox1.Focus() | |
End Sub | |
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged | |
Try | |
opt = CUInt(TextBox1.Text) | |
Label1.Text = names(opt) | |
Catch ex As Exception | |
Label1.Text = "Error" | |
End Try | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment