|
-
Oct 9th, 2008, 06:42 PM
#1
Thread Starter
Member
how to check this values in a textbox?
binary value in a textbox
hexadecimal value in a textbox
octal value in a textbox
decimal value in a textbox
it would display invalid input if none of those exist
-
Oct 9th, 2008, 06:58 PM
#2
Frenzied Member
Re: how to check this values in a textbox?
Check out the following functions:
Hex
Oct
-
Oct 10th, 2008, 09:26 AM
#3
Re: how to check this values in a textbox?
Rather than checking specific types, wouldn't it be easier to simply ensure the textbox would not accept alpha characters?
-
Oct 10th, 2008, 10:00 AM
#4
Re: how to check this values in a textbox?
Ohhhhh.. sorry!!
I thought I was in the VB.NET forum.
-
Oct 10th, 2008, 10:21 AM
#5
Re: how to check this values in a textbox?
 Originally Posted by Hack
Rather than checking specific types, wouldn't it be easier to simply ensure the textbox would not accept alpha characters?
Opting out alpha characters would be wrong.
e.g.
B1C24 is a valid Hexadecimal value, but contains alpha characters.
A better method is to create a function. In the function try to convert the value. If you get an error, that means it can not be converted, so return false. Otherwise return true.
Pradeep
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|