+ Reply to Thread
Results 1 to 3 of 3

TextBox that only accepts integers?

  1. #1
    Claud Balls
    Guest

    TextBox that only accepts integers?

    What would be the best way to check that text is a positive whole
    number? I'm thinking about putting it in the textbox_exit event.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

  2. #2
    Harald Staff
    Guest

    Re: TextBox that only accepts integers?

    Hi

    Exit is too late. Use the Keypress event. Set keyascii to 0 if its < 48 or
    >57.


    Except (tricky part coming up): Keydown event to trap and validate Ctrl V.

    HTH. Best wishes Harald

    "Claud Balls" <[email protected]> skrev i melding
    news:eM$%[email protected]...
    > What would be the best way to check that text is a positive whole
    > number? I'm thinking about putting it in the textbox_exit event.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!




  3. #3
    Jim Thomlinson
    Guest

    RE: TextBox that only accepts integers?

    You can validate the contents of the textbox using the isnumeric function.
    You will also have to look for "-" and "." using the instr function.


    "Claud Balls" wrote:

    > What would be the best way to check that text is a positive whole
    > number? I'm thinking about putting it in the textbox_exit event.
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1