G
Guest
vb.net 2003
i have the following procedure
Private Sub StrLicence_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles StrLicence.KeyPress
Select Case e.KeyChar
Case Microsoft.VisualBasic.ChrW(13)
MsgBox(" ENTER PRESSED")
' move to next field
Case Microsoft.VisualBasic.ChrW(8)
MsgBox(" backspace PRESSED")
Case Microsoft.VisualBasic.ChrW(9)
MsgBox("TAB PRESSED")
' move to next field
Case Microsoft.VisualBasic.ChrW(48) To
Microsoft.VisualBasic.ChrW(57)
MsgBox(" NUMBER PRESSED")
Case Else
' show error
MsgBox("MUST BE NUMERIC")
End Select
End Sub
what i want to do is in this case if an alpha charachter is pressed, i show
the must be numeric message, but i also want to stop that character being
displayed ...
i have the following procedure
Private Sub StrLicence_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles StrLicence.KeyPress
Select Case e.KeyChar
Case Microsoft.VisualBasic.ChrW(13)
MsgBox(" ENTER PRESSED")
' move to next field
Case Microsoft.VisualBasic.ChrW(8)
MsgBox(" backspace PRESSED")
Case Microsoft.VisualBasic.ChrW(9)
MsgBox("TAB PRESSED")
' move to next field
Case Microsoft.VisualBasic.ChrW(48) To
Microsoft.VisualBasic.ChrW(57)
MsgBox(" NUMBER PRESSED")
Case Else
' show error
MsgBox("MUST BE NUMERIC")
End Select
End Sub
what i want to do is in this case if an alpha charachter is pressed, i show
the must be numeric message, but i also want to stop that character being
displayed ...