hello everybody, this is my first post although i've learned very much from the forum. I am having problems trying to allow only numbers to be entered into my textbox, this is a n00b mistake i know but i really can't figure it out. i know it has to be in the textbox_keydown event but i really need some other opinions.
my code is below.. what am i doing wrong?
Code:Private Sub txtPsx_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPsx.KeyDown Select Case e.KeyValue Case Keys.A To Keys.Z e.Handled = False MsgBox("Please enter a number.", MsgBoxStyle.OkOnly) Case Keys.D0 To Keys.D9 e.Handled = True Case Else e.Handled = True End Select End Sub




Reply With Quote