CMFCMaskedEdit::EnableSelectByGroup

Specifies whether the masked edit control allows the user to select particular groups input, or all input.

void EnableSelectByGroup(
   BOOL bEnable=TRUE 
);

Parameters

  • [in] bEnable
    TRUE to select only groups; FALSE to select the whole text. The default value is TRUE.

Remarks

Use this function to specify whether the masked edit control allows a user to select by group or the whole text.

By default, selection by group is enabled. In this case the user can select only continuous groups of valid characters.

For example, you might use the following masked edit control to validate a telephone number:

m_wndMaskEdit.EnableMask(

_T(" ddd ddd dddd"),// Mask string

_T("(___) ___-____"),// Template string

_T(' '));// Default char

m_wndMaskEdit.SetValidChars(NULL); // All characters are valid.

m_wndMaskEdit.SetWindowText(_T("(425) 555-0187")); // Prompt

If selection by group is enabled, the user can retrieve only the "425", "555", or "0187" string groups. If group selection is disabled the user can retrieve the whole text of the telephone number: "(425) 555-0187".

Requirements

Header: afxmaskededit.h

See Also

Reference

CMFCMaskedEdit Class

Hierarchy Chart