Click here to Skip to main content
15,851,514 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I have a text box which displays percentage of student marks.I want to compare this value with some range values like for example if textbox1.text>=95
then textbox2.text="A" how it will be possible

1 solution

First use int.TryParse to get an int value, then you can do the comparison exactly as you wrote it. Use tryparse b/c it will let you check gracefully if a non number was entered ( it will just return false )
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900