CMFCPropertyGridProperty numeric input

I am using the MFC function package and I have a dockable properties window. How can I prevent a user from entering any other characters besides numbers in the value field?

Thanks...

+3
source share
1 answer

One of the constructors of the CMFCPropertyGridProperty class has the lpszValidChars parameter, which you can use to limit the input characters. eg.

CMFCPropertyGridProperty* pProp = new CMFCPropertyGridProperty(_T("Numeric Value"),
        (_variant_t) 250l, _T("A numeric value"), NULL, NULL, NULL, 
        _T("0123456789"));

The last parameter restricts the characters that can be entered.

+4
source

Source: https://habr.com/ru/post/1716073/


All Articles