winforms - c# text box "between" validation -
i trying have text box validate if entry number between 1 , 100.
example:
if (textbox.text equal numbers between 1 , 100) { this; } else { this; }
this form validation trackbar used jpeg compression , can have numeric values between 1 , 100. how do this?
string text = textbox.text; try{ long value = long.parse(text.trim()); if(value > 0 && value < 101){ //do here } else{ //do else } } catch(exception e){ messagebox.show("please check input , try again"); }
Comments
Post a Comment