programlover83
Programmer
How can I limit the keypress event for just handling the decimal numbers, to be precise how can I enter some amount with only 2 decimal places.
Here is the skeleton of what I am working on:
Private Sub KeyPressingNum(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim KeyAscii As Integer
KeyAscii = Asc(e.KeyChar)
Select Case KeyAscii
Case Is < Keys.Space
'Ignore
Case Keys.D0 To Keys.D9
'Ignore
Case Else
MessageBox.Show("Please enter only numbers.", "Error"
e.Handled = True
End Select
End Sub
Any help would be great.
Thanks
Here is the skeleton of what I am working on:
Private Sub KeyPressingNum(ByVal e As System.Windows.Forms.KeyPressEventArgs)
Dim KeyAscii As Integer
KeyAscii = Asc(e.KeyChar)
Select Case KeyAscii
Case Is < Keys.Space
'Ignore
Case Keys.D0 To Keys.D9
'Ignore
Case Else
MessageBox.Show("Please enter only numbers.", "Error"
e.Handled = True
End Select
End Sub
Any help would be great.
Thanks