Link to home
Start Free TrialLog in
Avatar of Abdu_Allah
Abdu_Allah

asked on

How to make textbox accept just numbers(from 0 - 9)?

How to make textbox accept just numbers(from 0 - 9)?
Regards.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Imports Microsoft.VisualBasic
       
        Dim MyInt As Integer
        If IsNumeric(txtbox.Text) Then MyInt = txtbox.Text
        If MyInt >= 0 And MyInt <= 9 Then
            'do something
        Else
            'err msg
        End If
Avatar of Abdu_Allah
Abdu_Allah

ASKER

Actually I want to use a validator control, like comparevalidator.
i think the required field validator allows you to put in a min and max value....
I do not want range validation I just want to accept numbers, no aphabatic characters.
ASKER CERTIFIED SOLUTION
Avatar of Elvio Lujan
Elvio Lujan
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
RainMan82... you think bad :)