CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Candia, NH
    Posts
    374

    Numeric input only in Edit box

    As I understand it if one has the ES_NUMBER style on an Edit box in the resource file the edit box should only accept digits as input. It looks like this:

    CONTROL "", EDIT_LATBOX, "EDIT", ES_LEFT |
    ES_NUMBER | WS_CHILD | WS_VISIBLE |
    WS_BORDER | WS_GROUP | WS_TABSTOP,
    96, 108, 28, 9

    Yet I can freely input any text I want into the box and even retrieve it. Is there something wrong with the above resource line?

    Thanks for any hints. I don't want to capture keyboard input and filter ASCII 0x30 to 0x39 like in DOS!

  2. #2
    Join Date
    Dec 2002
    Posts
    1,050
    What compiler and what OS ?? Working for me with vc6/7 on 2000
    Both CONTROL and EDITTEXT are working with es_number.

    Also you can try SetWindowLong() after the dialog is created to
    see if that applys the style.

  3. #3
    Join Date
    Feb 2003
    Posts
    35
    Don't rely on ES_NUMBER, check input yourself.
    ES_NUMBER does not effect clipboard pasting.

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