Alright here's the deal, I have numerous text boxes on a form and I want to be able for the user only to be able to enter integers or decimal numbers within the text boxes. Right now this is the current code I have in order for them to only be able to enter integers but I want to be able integers and decimals if needed, how can I adapt this code in order for this to happen?
Private Sub txtL5_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtL5.KeyPress
If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
End If
End Sub
Private Sub txtL5_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtL5.KeyPress
If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
End If
End Sub