Drstein99
Well-known member
PLEASE POST REPLIES IN VB.NET SYNTAX ONLY
Im using keypress event, to trigger validation:
Public Sub esKeyPressInteger(ByVal sender As Object, ByVal e As KeyPressEventArgs)
and the VALUE of keys.delete (46) IS the same ASCII value of the ascii code for "." (decimal point)
How do i figure out that the char entered is only numeric, and also allow a delete or arrow key? Im using this and its malfunctioning:
If (Char.IsNumber(e.KeyChar) Or Asc(e.KeyChar) = Keys.Delete Or Asc(e.KeyChar) = Keys.Back) AND ASC(E.KeyChar) <> KEYS.Decimal Then
e.Handled = False
Else
e.Handled = True
End If
Im using keypress event, to trigger validation:
Public Sub esKeyPressInteger(ByVal sender As Object, ByVal e As KeyPressEventArgs)
and the VALUE of keys.delete (46) IS the same ASCII value of the ascii code for "." (decimal point)
How do i figure out that the char entered is only numeric, and also allow a delete or arrow key? Im using this and its malfunctioning:
If (Char.IsNumber(e.KeyChar) Or Asc(e.KeyChar) = Keys.Delete Or Asc(e.KeyChar) = Keys.Back) AND ASC(E.KeyChar) <> KEYS.Decimal Then
e.Handled = False
Else
e.Handled = True
End If