Ahmadal_najjar2003
asked on
How Also to let text accept point .
I have a text box , I want it to accept both numbers and point just to enter amount like this 2.75 .
Private Sub thiscontrol_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPr essEventAr gs) Handles thiscontrol.KeyPress
If Char.IsNumber(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
End If
End Sub
What also I have to add. ?
Private Sub thiscontrol_KeyPress(ByVal
If Char.IsNumber(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
End If
End Sub
What also I have to add. ?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks Alot
add this OR condition also, this will make sure only once "." is entered