BCGControlBar Pro for MFC
void CBCGPMaskEdit::SetValidChars ( LPCTSTR  lpszValid = NULL)

Sets a string containing a list of valid characters.

Parameters
lpszValidA string interpreted as a set of valid characters. NULL means that all possible characters are valid.

Use this function to define a list of valid characters. If an entered character is not in this list, masked edit control will not accept it.

For example, if you want to create a masked edit control that accepts only hex numbers, you should do the following:

Copy
// Mask: 0xFFFF
m_wndMaskEdit.EnableMask(
L" AAAA", // The mask string
L"0x____", // Literal, "_" char = character entry
'_'); // Backspace replace char
// Valid string characters
m_wndMaskEdit.SetValidChars(L"1234567890ABCDEFabcdef");
m_wndMaskEdit.SetWindowText(L"0x01AF");