Validate an edit control

Discussion in 'Win32' started by Joelito, Sep 1, 2010.

  1. Joelito

    Joelito New Member

    Joined:
    Sep 1, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi!

    How do you guys validate an edit control to accept only some chars?
    I have a theory about it...

    1.- subclass the edit control
    2.- trap the WM_KEYPRESS or WM_CHAR
    3.- test the character stroke.

    is this the proper way?

    Additional: I'm trying to accept only the following chars: 0-9 and .
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    Yes. This is the ideal way
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice