Click to See Complete Forum and Search --> : Numeric input only in Edit box


Gyannea
February 12th, 2003, 05:57 PM
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!

mdmd
February 12th, 2003, 10:11 PM
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.

mamut
February 13th, 2003, 04:07 AM
Don't rely on ES_NUMBER, check input yourself.
ES_NUMBER does not effect clipboard pasting.