CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    72

    I don't know this function

    Which is the function that allows me to check from code if the content of an edit text -on a dialog box- has only numbers?

  2. #2
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443
    There is no direct way. One solution is to fetch the string and check each character with isdigit().
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

  3. #3
    Join Date
    Nov 2001
    Location
    Beyond Juslibol
    Posts
    1,688
    There is an alternative if your edit box has the "only numbers" style. This way you don't need any fuction because only positive integer numbers can be entered.

  4. #4
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443
    Originally posted by Doctor Luz
    There is an alternative if your edit box has the "only numbers" style. This way you don't need any fuction because only positive integer numbers can be entered.
    Yup, but that is rather enforcing than testing
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

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

Featured