Check if textbox is a Valid Integer from 0 to 10000.
How can I check if a textbox contains a number that is a valid integer (just numbers) and that its a number from 0 to 10000 The way i did was in loops which would freeze the program for a few seconds. Any other ways
Check if textbox is a Valid Integer from 0 to 10000.
Jason Chan
int is a type. It's visible from everywhere. As in, dim i as int.
sbeider
first use int.tryparse to see if it's a number. Then check if that int is in the range you want.
Or, use a masked text box to specify the input range you require
*Elad*
dim tst as int16
tst.tryparse(text1.text, what here )
zhuyanjun
dim ggg as integer
if integer.tryparse(files.text,ggg) = false then
'Invalid Integer
end if
cbwick
Paulo Silva Jr.
No, tryparse is a static method
dim tst as int16
if int.tryparse(text1.text, out tst) then
end if
http://windowssdk.msdn.microsoft.com/library/default.asp url=/library/en-us/cpref6/html/M_System_Int32_TryParse_1_0b81a80f.asp