Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27510

Numeric validation for textboxes

$
0
0
Hello All,
I have a RecordNumber textbox with 5 digit limit. The users can enter any number between 0 and 9.
However, they CANNOT start with 00. They can enter 12349 or 10234 or 12340 or 12023, but NOT 00123. Can you please help me with this? Your help is greatly appreciated! Thank you very much!

This only allow the user to enter number between 0-9 in the textbox:
Private Sub RecordNumber_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles txtRecordNumber.KeyPress
Select Case e.KeyChar
Case "0"c To "9"c
e.Handled = False
Case Else
e.Handled = True
End Select
End Sub

Viewing all articles
Browse latest Browse all 27510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>