Skip to content

Instantly share code, notes, and snippets.

@jda0
Created December 12, 2013 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jda0/7932002 to your computer and use it in GitHub Desktop.
Save jda0/7932002 to your computer and use it in GitHub Desktop.
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