Numeric entry filter

VCE

New Member
Licensed User
Longtime User
I am trying to do something similar to the VB6 code below to filter the text input to numeric only including a decimal point. Is there a way of accomplishing this in B4A?

VB6 CODE:

Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 46, 48 To 57
Case Else
KeyAscii = 0
End Select
End Sub

Thanks,
Chriss
 

VCE

New Member
Licensed User
Longtime User
Thank you Klaus!
That makes a great filter.
Do you know how to let the text box only accept decimal numbers with only 1 decimal allowed such as in a calculator? The examples are great for IP addresses and similar but I can't get it to do decimal numbers only.
 
Top