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
Post a Comment