Quote Originally Posted by .paul. View Post
Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    Dim validChars() As Char = {"1"c, "2"c, "3"c}
    e.Handled = Not (validChars.Contains(e.KeyChar) OrElse Char.IsControl(e.KeyChar))
End Sub
Thanks for your kind support. Actually, I forgot to mention one thing that the user should enter any single character in that textbox (Ex: 1 or 2 or 3) not 2 characters like 12, 13, 31 etc.