c# - How to validate only number in winform? -



c# - How to validate only number in winform? -

how validate numbers without using keypress alternative why isnt char.isnumber or .isdigit working or should utilize regex look validation

private bool validatecontact() { if (char.isnumber(textbox4.text)){ homecoming true; }

you parse number:

private bool validatecontact() { int val; if (int.tryparse(textbox4.text, out val)) { homecoming true; } else { homecoming false; } }

you trying phone call method written char string. have them separately, or utilize method much easier use, above code.

c# winforms

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -