Results 1 to 5 of 5

Thread: how to check this values in a textbox?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    38

    Unhappy 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

  2. #2
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: how to check this values in a textbox?

    Check out the following functions:

    Hex
    Oct

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  4. #4
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: how to check this values in a textbox?

    Ohhhhh.. sorry!!

    I thought I was in the VB.NET forum.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: how to check this values in a textbox?

    Quote 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
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width